View Single Post
Go4Expert Member
3Jun2012,14:45  
abosirage's Avatar
hi every body
I need your help friends
I am inserting about 40 item in my database four time weekly , I want to get today insert date & the last inserted data in my php page to compare between them & show the graph
I use select twice to get current and previous but the result first and last,
my code is like
Code:
<?php 
   include ('config.php');
  $select = mysql_query("SELECT DISTINCT ...... FROM .... ORDER BY `id` desc") ;
while($row = mysql_fetch_array($select))
{
    $date[] = $row['.....'];    
 }
$ert= $date[1];
function isUnique($ert){ 
 
     return (array_unique($array) != $array); 
 }
 echo $ert;
$result = mysql_query("SELECT * FROM ...... WHERE ....='.......' or ......='......' or ......='..........' or ORDER BY `id` desc LIMIT 4");
?>  
    <?php 
   include ('config.php');
$result1 = mysql_query("SELECT * FROM ......... WHERE ......... ='......... ' or ......... ='......... ' or ......... ='......... ' or ORDER BY `id` asc LIMIT 4");

?>

Last edited by shabbir; 3Jun2012 at 16:05.. Reason: Code blocks