paulman888888 Posted April 9, 2009 Share Posted April 9, 2009 Hi; Ill get to the point. This code should work but i don't no why it doesn't. $query="INSERT INTO `requests` (`name`, `email`, `msg`, `status`) VALUES ('$name, '$email', '$msg', `$status`)"; And in my table there is id, name, email, msg, status. id=int name=varchar email=varchar msg=blob status=int Thankyou for all help in advance Paul Link to comment https://forums.phpfreaks.com/topic/153347-solved-error-with-php-mysql-wrong-syntax/ Share on other sites More sharing options...
Maq Posted April 9, 2009 Share Posted April 9, 2009 Don't use backticks for the value of $status. Just use single quotes: '$status' And use an or die(msql_error()) at the end of your query call. Link to comment https://forums.phpfreaks.com/topic/153347-solved-error-with-php-mysql-wrong-syntax/#findComment-805657 Share on other sites More sharing options...
Mark Baker Posted April 9, 2009 Share Posted April 9, 2009 And you're missing a closing quote after $name '$name, Link to comment https://forums.phpfreaks.com/topic/153347-solved-error-with-php-mysql-wrong-syntax/#findComment-805658 Share on other sites More sharing options...
MatthewJ Posted April 9, 2009 Share Posted April 9, 2009 If status is an int, it doesn't need quotes at all Link to comment https://forums.phpfreaks.com/topic/153347-solved-error-with-php-mysql-wrong-syntax/#findComment-805668 Share on other sites More sharing options...
paulman888888 Posted April 9, 2009 Author Share Posted April 9, 2009 thanks guys. It works now, i over looked that closes quote. Its always the little things, 8bit or 1 byte stopped a whole script from working. Thanks again Link to comment https://forums.phpfreaks.com/topic/153347-solved-error-with-php-mysql-wrong-syntax/#findComment-805671 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.