I got a problem when I run the below code:
function newUser($email,$pwd,$pwd2,$firstname,$surname,$isAdmin=0){
$email = $this->verify('Email',$email,10,40);
$pwd = $this->verify('Password',$pwd,6,20);
$pwd2 = $this->verify('Password',$pwd2,6,20);
$firstname = $this->strToTitle($this->verify('Name',$firstname,2,40));
$surname = $this->strToTitle($this->verify('Title',$surname,2,40));
if ($pwd != $pwd2)
return -1;
$key=md5("secure")
$result = $this->query("INSERT INTO user (email, pw, firstname, surname, isAdmin) VALUES (".$email.", AES_ENCRYPT(".$pwd.",".$key."), ".$firstname.", ".$surname.", ".$isAdmin.")");
if (mysql_affected_rows()>0)
return mysql_insert_id();
else
return 0;
}
It always prompt “Parse error: syntax error, unexpected ‘$result’ (T_VARIABLE) in F:\xampp\htdocs\sql.php on line 76”
Any one can keep me some advise??
Many thanks!!
A semi-colon is missing on the line assigning the result of the query to
$result, it should be: