1. Your <select> box doesn't have a name... it needs to be more like <select name="rate"> and then you will be able to use $rate in your script.
2. You need to somehow pass the ID of the picture in the form, like this - <input type="hidden" name="id" value="XXX"> - you change XXX with whatever is right according to your script.
3. This code:
PHP Code:
$count = mysql_query ("SELECT * FROM lookCount WHERE IDref = $id ");
$newcount = (($count + 3) /5);
You need to:
a) mysql_fetch_array() the $count before you could use the information from that query.
b) Use $count['count'] in your formula, not just $count.
4. And last but not least, you need to quote Submit in the following line:
PHP Code:
if ( $submitrate == Submit )
besides, I would use this instead (I don't know why, I just feel better with it
):
PHP Code:
if ( $submitrate != '' )
Edit:
One more thing... in the formula for calculating the new count:
PHP Code:
$newcount = (($count + 3) /5);
shouldn't you use the value from the <select> box as well here?
Bookmarks