views:

36

answers:

3

I'm trying to allow users to register with the site I am creating, however the code I am using is not working and I need you're help.

$registerquery = mysql_query("INSERT INTO users (Username, Password, EmailAddress) VALUES('".$username."', '".$password."', '".$email."'");

Database: alt text

I only want to store the Username, Password and Email Address at this stage.

A: 
$registerquery = mysql_query("INSERT INTO `users` (`Username`, `Password`, `EmailAddress`) VALUES ('".$username."', '".$password."', '".$email."')");
john010117
+6  A: 

You're missing a ) at the end of the query.

$registerquery = mysql_query("INSERT INTO users (Username, Password, EmailAddress) VALUES('".$username."', '".$password."', '".$email."')");
ShaneB
Haha, Thanks :)
ritch
A: 

You are missing the closing bracket in your SQL query. Try this line:

$registerquery = mysql_query("INSERT INTO users (Username, Password, EmailAddress) VALUES('".$username."', '".$password."', '".$email."')");

Note the ) at the end: "')");

Valorin
Ok, I was beaten to it.
Valorin