blong4life Posted December 30, 2006 Share Posted December 30, 2006 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 40Which is the SQL line. After my testing and Diagnostics I cant find the error. ??? Quote Link to comment Share on other sites More sharing options...
Vikas Jayna Posted December 30, 2006 Share Posted December 30, 2006 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.