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. ??? Link to comment https://forums.phpfreaks.com/topic/32240-mysql-error/ 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 Link to comment https://forums.phpfreaks.com/topic/32240-mysql-error/#findComment-149709 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.