Forum Moderators: coopster
$result = $db->EXECUTE($sql);
$c1 = mysql_fetch_array($result);
while($c1 = mysql_fetch_array($result)){
echo "$c1[date]<br>";
}
that way I get all the dates i.e.
2003-01-28
2003-05-24
2003-07-11
2003-07-13
I need to get the smallest date $C1[date] which is "2003-01-28" how can I assign it to a $variable?
please help
thank you
$sql2 = Select min(date) as theone from results where user_id ='$user_id'
$q = mysql_query($sql2);
$qr = mysql_fetch_array($q);
$smallestdate = $qr['theone'];
take a look at
Functions for Use with GROUP BY Clauses [mysql.com]