Quote:
Originally Posted by Quillink
:o
Lol. Trust me to pick the abstract, complex way right off the bat. I'll definitely do that Brandon, thanks for suggesting it. :D
EDIT: It's really hard to see if it's working, but does this look functionable to you guys?
Code:
$query = "SELECT * FROM ".$prefix."vote_voters WHERE adoptableid='$id' and date = '$date'";
$result = mysql_query($query);
$ctd = mysql_numrows($result);
if ($ctd <= 9) { $addclicks = 1; }
else { $addclicks = 0; }
$newclicks = $totalclicks + $addclicks;
|
It looks like it should work, but why not just check if you should add the click or not and if not just don't do the database queries and instead show the user an error message. On a large site there's no need to run unnecessary queries. :)
You'll be able to tell if it is working too that way. :)