View Single Post
  #9  
Old 02-07-2010, 07:37 PM
Quillink Quillink is offline
Member
 
Join Date: Dec 2008
Posts: 93
Credits: 16,233
Quillink
Default RE: Limit clicks/day to 10, for each pet?

I thought I needed the query to check the number of rows in the votes table? Sorry Brandon, but could you show me an example..? :S

EDIT: Is this what you meant?
Code:
$query = "SELECT * FROM ".$prefix."vote_voters WHERE adoptableid='$id' and date = '$date'";
$result = mysql_query($query);
$ctd = mysql_numrows($result);
if ($ctd > 99)		 { $article_title = "Error";
						 $article_content = "<font color='#cc1111'>This Pet has recieved the maximum of 100 clicks per day</font>"; }
else   if ($ctd <= 99) {

// Add to clicks, levelup and text return

}
This way it doesn't bother with the other queries if the click limit's already been reached. :)
Reply With Quote