it as been 6 months that im trying to figure out this problem!
and i cannot solve it ,here is my code:
Code: Select all
$sql_f="SELECT reg_id, count(bid_price) as cnt, min(bid_price) as low FROM `bidding_details` where bid_id='$bid_id' and sortbid = '1' group by reg_id HAVING COUNT(reg_id) > 9 limit 50";
$results=mysql_query($sql_f)or die(mysql_error());
$row = mysql_fetch_assoc($results);
$num = $row['low'];
$cnt = $row['cnt'];
if($cnt > 9) {
$sql_u="update bidding_details set sortbid = '0' ,rank = '0' where bid_id='$bid_id' and bid_price='$num'";
mysql_query($sql_u)or die(mysql_error());
}maybe there is other way to do it?
what im trying to do is:
i want to limit users to have maximum 9 records in the first 50 records, if user got 10 ,then this record will be updated to SORTBID='0'
my problem now is that the limit is not working ,there results are taken from more then 50 rows!!
please please help me with that!!
thanx