View Full Version : Resolved Fetching And Updating

04-16-2012, 11:11 AM
$textads=mysql_fetch_array(mysql_query("SELECT * FROM ads where text='1' and expired='0' ORDER BY RAND() LIMIT 1"));

mysql_query("update ads set impdone=impdone+1 where id=$adsid");

This code should fetch 1 result, its fetching only 1 result but its updating 2 random rows with impdone+1 value ...
please tell me whether the code is ok or not ?? and solution