I am writing a thumb up/down rating system on items, The rating system should allow the user to rate only one time. I have an SQL table in the database named rating with columns : id, itemname, commentno. and another table ip_check that has : id, commentno, ip.
The commentno will be a foreign key and the syntax to get the ip should be like this : <?php $ip = $_SERVER['REMOTE_ADDR']; ?>
as I checked on line on several links like this one.
Now what is the proper and easiest way to add a mysql if condition. I checked this link as well but I am still looking for something more specific, any help on this?