Vivid Lust Posted September 1, 2008 Share Posted September 1, 2008 Hi, I'm new to MySQL and was just wondering what im doing wrong with this query: <?php $unkn = "unknown"; $zero = "0"; $user = mysql_query(" INSERT INTO `users` ( `email`, `pass`, `name`, `gender`, `location`, `about`, `s_phish`, `u_phish`, `p_phish`, `p_s`, ) VALUES ( \"$email\", \"$pass\", \"$name\", \"$unkn\", \"$unkn\", \"$unkn\", \"$zero\", \"$zero\", \"$zero\", \"$zero\" ) ") or die("could not execute insert query"); ?> [code] It keeps on dying The previous variation worked: [code] $user = mysql_query(" INSERT INTO `users` ( `email` , `pass` , `name` ) VALUES ( \"$email\", \"$pass\", \"$name\" ) "); But not this one... any help really appreciated [/code][/code] Quote Link to comment Share on other sites More sharing options...
fenway Posted September 1, 2008 Share Posted September 1, 2008 Until you echo that query in plaintext, we can't possibly know. Quote Link to comment Share on other sites More sharing options...
Vivid Lust Posted September 1, 2008 Author Share Posted September 1, 2008 I get: INSERT INTO `users` ( `email`, `pass`, `name`, `gender`, `location`, `about`, `s_phish`, `u_phish`, `p_phish`, `p_s`, ) VALUES ( "", "", "", "unknown", "unknown", "unknown", "0", "0", "0", "0" ) Spaces are where variables are which do work, so i suspose they dont really matter at the moment. Quote Link to comment Share on other sites More sharing options...
toplay Posted September 1, 2008 Share Posted September 1, 2008 Remove the comma after p_s column. Change this: `p_s`, ) to this: `p_s`) 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.