Jump to content

MySQL Error


blong4life

Recommended Posts

I dont know if this belongs in PHP help or MySQL help since its both, but I keep getting an error on the following SQL/PHP statment.

[code=php:0]$sql = 'INSERT INTO `users` (`userid`, `username`, `password`, `userlevel`, `usertitle`, `email`, `signupdate`, `profileedit`, `lastactivity`, `online1`, `online2`, `aim`, `msn`, `yahoo`, `website`) VALUES ("NULL, '$username', '$password', '$userlevel', '$usertitle', '$email', '$date', '$date', '$date', '$online1', '$online2', '$aim', '$msn', '$yahoo', '$website'");';

$query = mysql_query($sql) or die("<b>User Not added.<br /></b><br />Error:".mysql_error());[/code]

Parse error: syntax error, unexpected T_VARIABLE in /home/blong/public_html/admin/add-user.php on line 40

Which is the SQL line. After my testing and Diagnostics I cant find the error. ???
Link to comment
https://forums.phpfreaks.com/topic/32240-mysql-error/
Share on other sites

This is a PHP parsing error. Change the line to:

[code]$sql = "INSERT INTO `users` (`userid`, `username`, `password`, `userlevel`, `usertitle`, `email`, `signupdate`, `profileedit`, `lastactivity`, `online1`, `online2`, `aim`, `msn`, `yahoo`, `website`) VALUES (NULL, '$username', '$password', '$userlevel', '$usertitle', '$email', '$date', '$date', '$date', '$online1', '$online2', '$aim', '$msn', '$yahoo', '$website')";[/code]

The problem is because of improper quotes
Link to comment
https://forums.phpfreaks.com/topic/32240-mysql-error/#findComment-149709
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.