How is every doing? I'm working on an email registration script, final thought I was done, but I keep getting this error read out:
Here is a bit of my code:
I think it is referring to my
I don't see anything wrong with the line, but then again I'm a newbie to php. Does anyone know why I am getting this error and how I can fix it?
Thank you for your help!
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5
PHP Code:
<?php
mysql_connect("localhost", "USERNAME", "PASSWORD") or die("Could not connect to database");
mysql_select_db("email") or die(mysql_error());
if ($_POST['form_submitted'] == '1') {
## The form was submitted, the user is registering.
$activationKey = mt_rand() . mt_rand() . mt_rand() . mt_rand() . mt_rand();
$username = mysql_real_escape_string($_POST["username"]);
$password = mysql_real_escape_string($_POST["password"]);
$email = mysql_real_escape_string($_POST["email"]);
PHP Code:
mysql_select_db("email") or die(mysql_error());
Thank you for your help!
Comment