Variable values are not evaluated within a string with single quotes:
mysql_query("INSERT INTO votes (voter, photoid, photoowner, vote) VALUES ('$voter', '$photoid', '$photoowner', 'yes')");
put double quotes around your select statement or use concatenation and don’t forget to put quotes around your string values
Also use use mysql_error() to retrieve the error text
10
solved Something wrong with php code [closed]