wee493 Posted June 11, 2010 Share Posted June 11, 2010 I keep getting an error with this query, what could be wrong with it? Here is my database http://grab.by/grabs/e2245fe272af915a98f186b9e9966ee1.png $query = mysql_query("INSERT INTO scrobble ('lfmuser', 'artist', 'artistmbid', 'name', 'album', 'albummbid', 'trackurl', 'playdate', 'nicedate') VALUES ('$user', '$artist', '$artist_mbid', '$name', '$album', '$album_mbid', '$url', '$date', '$nicedate')") or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/204469-is-something-wrong-with-this-query/ Share on other sites More sharing options...
wee493 Posted June 11, 2010 Author Share Posted June 11, 2010 Sorry, forgot to put that this is the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''lfmuser', 'artist', 'artistmbid', 'name', 'album', 'albummbid', 'trackurl', 'pl' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/204469-is-something-wrong-with-this-query/#findComment-1070715 Share on other sites More sharing options...
PFMaBiSmAd Posted June 11, 2010 Share Posted June 11, 2010 You need to remove the single-quotes that are around your column names in the query. Single-quotes are used around string data values, not column names. Quote Link to comment https://forums.phpfreaks.com/topic/204469-is-something-wrong-with-this-query/#findComment-1070755 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.