It seems there is a parse error with my mysql and php code can some please help me clean up this code.
$tag = mysql_real_escape_string($_POST['tag']); $query = 'UPDATE tags SET count = count+1 WHERE tag = '.$tag; mysql_query($query,$dbc); if( !mysql_affected_rows() ) { $query = 'INSERT INTO tags (tag,count) VALUES('.$tag.',1)'; if (mysql_query($query,$dbc)); { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($dbc)