runnerjp Posted February 13, 2010 Share Posted February 13, 2010 where am i going wrong here: $insert = mysql_query("REPLACE INTO `users` SET `".$forum."`=`".$timestamp."` where id = `".$id."`") or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/191990-you-have-an-error-in-your-sql-syntax-check-the-manual-that-corresponds-to-your/ Share on other sites More sharing options...
sader Posted February 13, 2010 Share Posted February 13, 2010 surround table names, field names db's names by `, but field values surround by ' or " SELECT * FROM `table` WHERE `name`='user_name'; Link to comment https://forums.phpfreaks.com/topic/191990-you-have-an-error-in-your-sql-syntax-check-the-manual-that-corresponds-to-your/#findComment-1011953 Share on other sites More sharing options...
Mchl Posted February 13, 2010 Share Posted February 13, 2010 That's exactly why you should not use backticks. You use too many of them. $insert = mysql_query("REPLACE INTO users SET $forum ='$timestamp' where id = $id") or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/191990-you-have-an-error-in-your-sql-syntax-check-the-manual-that-corresponds-to-your/#findComment-1011955 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.