Clifton Miranda Clifton Miranda - 1 year ago 66
MySQL Question

I want the last value from a sql column with where condition

I want the last value from my query .
i tried end();
did not work..

$last_ad_idx=mysql_query("SELECT ads_id FROM ads WHERE id='$id'");
$target_ad_id = mysql_fetch_array($last_ad_idx);

Answer Source
 SELECT ads_id FROM ads WHERE id='$id' order by ads_id desc limit 1
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download