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. Quote Link to comment 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. Quote Link to comment 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' )"; Quote Link to comment 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.