kigogu Posted June 21, 2012 Share Posted June 21, 2012 For some reason i'm getting: 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 ' Here is the query that i'm running: 'INSERT INTO template_information (html, css, div_tag) VALUES( "' . $html . '", "' . $css . '", "' . $div_tags . '" )' It worked fine till I added 'div_tag', but as far as I can see I added it to the query correctly so I don't know why its giving me this error. Link to comment https://forums.phpfreaks.com/topic/264572-1064-error-help-please/ Share on other sites More sharing options...
Pikachu2000 Posted June 21, 2012 Share Posted June 21, 2012 Echo your query string and inspect it to make sure it contains the values you'd expect it to contain. Link to comment https://forums.phpfreaks.com/topic/264572-1064-error-help-please/#findComment-1355969 Share on other sites More sharing options...
Barand Posted June 21, 2012 Share Posted June 21, 2012 it is so much easier to use "" around the query and avoid all that concatenation eg $sql = "INSERT INTO template_information (html, css, div_tag) VALUES( '$html', '$css', '$div_tags' )"; Link to comment https://forums.phpfreaks.com/topic/264572-1064-error-help-please/#findComment-1355972 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.