chand.sethi77 Posted April 7, 2011 Share Posted April 7, 2011 Tell me the correct syntax for INSERT INTO updatesMy code is as follows: <?php$name = $_POST['name'];$email = $_POST['email'];$subject = $_POST['subject'];$catagory = $_POST['catagory'];$content = $_POST['content'];?><?php$insert = mysql_query("INSERT INTO updates (name, email, subject, catagory, content) VALUES($name, $email, $subject, $catagory, $content) ");if (!$insert) { die ("Error in inserting your query. " . mysql_error()); }?> The error is Error in inserting your query. 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 '@gmail.com, Something, arts, Does it happen? on line 2. Please copy the code, do the desirable changes and post it back . THANKSCHAAND SETHI Link to comment Share on other sites More sharing options...
justsomeguy Posted April 7, 2011 Share Posted April 7, 2011 You need to quote all strings in your queries. Only numbers don't need to be quoted. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.