I can't find the error!

A

Anonymous

Guest
Code:
$query_id = "ALTER TABLE members //111
	DROP id";  //112
$result_id = mysql_query($query_id);  //113
$query_id2 = "ALTER TABLE members  //114
ADD id TINYINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST";  //115
$result_id2 = mysql_query($query_id2);  //116
$query_register = "INSERT INTO members (id,username,password,date_registered)  //117
	VALUES ('','".$_POST['registerusername']."',password('".$_POST['registerpassword']."'),NOW()";  //118
$result_register = mysql_query($query_register);  //119
setcookie("le_username",$_POST['registerusername']);  //120
header("Location: index.php");  //121

It keeps saying there is a parse error on line 118, but i dont see any on 118 or before it...

oh yeah i just noticed, here, line 118 is too long, so there is 2 lines, just so no one gets confused.
 
NOW()";
the " there doesnt seem to have a first " ... its just there for no reason it seems try taking it out
 
nvm i see where the first one is.... im not sure either.
what else does it say besides parse error on line 118... if anything.
 
NOW() should be within the VALUES braces as far as I see - actually as password() has a brace set - the only thing missing is the closing brace for VALUES()

VALUES ('','".$_POST['registerusername']."',password('".$_POST['registerpassword']."'),NOW())";
 
35.gif
59.gif
 
omg how could i have missed that lol.

Thank you pootergeist. I spent about 2 days pondering over that error.
 
Back
Top