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 Quote 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. Quote 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, Quote 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 Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.