I need to know if the last 5 entry's in a table were placed by the same userid (in the code below the user id is frozen_by
.
Here's what I have
//count if the last 5 freezes was placed by the same user
$strFind="SELECT COUNT(*) AS `total` FROM `contest_frozen` WHERE `contest_id`=\"$pid\" AND `frozen_by`=\"$curmemid\" ORDER BY `id` DESC LIMIT 5";
$result=mysql_query($strFind) or die(mysql_error());
$row=mysql_fetch_array($result);
$freeze_total=$row['total'];
if($freeze_total>=5){
//do this
}
if($freeze_total<5){
//do this
}