...

View Full Version : Resolved Fetching And Updating



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




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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum