ritch
ritch

Reputation: 1808

Help - Insert into MySQL Database Using PHP

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 http://img248.imageshack.us/img248/2457/screenshot20100805at001.png

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

Upvotes: 0

Views: 838

Answers (3)

Stephen RC
Stephen RC

Reputation: 1504

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: "')");

Upvotes: 0

LizB
LizB

Reputation: 2213

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

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

Upvotes: 7

john010117
john010117

Reputation: 201

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

Upvotes: 0

Related Questions