i got auction site for highest unique bid is the winner ,and i want to give a limit to users bids ,what i want is that users cannot have 5 bids in a row ,only 4 ,if they bid and the last bid is between the 4 bids they all ready bid ,then the last bid will be deleted, users can have groups of 4 bids in a row not groups of 5 ,my query is in ORDER by bid_price DESC
this is the code i got for the moment but it is limiting the user to have maximum 4 bids from the total of 50:
[code=php]$query = mysql_query(“SELECT * FROM `bidding_details` where bid_id=’$bid_id’ and username=’$username’ order by bid_price desc limit 50″) or die(mysql_error());
$last = ”;
$count = 0;
while($line = mysql_fetch_assoc($query)) {
if($last == $line[‘username’]) $count++;
else {
$last = $line[‘username’];
$count = 1;
}
if($count == 4) {
header(“location:product_detailframe.php?msg=11&&bid_id=$bid_id”);
exit;
}
}
thanx !!!!