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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.