i got this code:
what im trying to do is find if a user got over 9 rows in the query result!
if he got 10 ,the lowest bid is updated!
my problem is that the limit is not working!
the problem is that if i got over 50 rows ,lets say 70 rows and the user got 7 rows in the first 50 rows , and 3 more in the other 20 rows then the lowest bid is
updating too!
i dont understand why the limit is not working!
thanx in advanced!!!
Code:
$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());
}
if he got 10 ,the lowest bid is updated!
my problem is that the limit is not working!
the problem is that if i got over 50 rows ,lets say 70 rows and the user got 7 rows in the first 50 rows , and 3 more in the other 20 rows then the lowest bid is
updating too!
i dont understand why the limit is not working!
thanx in advanced!!!
Comment