View Full Version : Need a quick syntax correction

04-17-2009, 12:23 AM
$sql="INSERT INTO frm_users (`username`, `password`, `user_email`, `user_level`, `user_dateformat`, `user_allowhtml`, `user_allowbbcode`, `user_allowsmile`, `user_allowavatar`, `user_allow_pm`, `user_allow_viewonline`) VALUES ('$username', '$md5password', '$email', '0', 'D M d, Y g:i a', '1', '1', '1', '1', '1', '1', )";

I'm trying to incorporate a registration from my game to make an account on a phpbb2 forum.

As far as I can see the code its fine, however is says something about line 1 having incorrect syntax or something?

$Any_help == appreciated;

04-17-2009, 01:00 AM
You should always post the exact error message. Help a lot. Also the context of your code should be posted; what's happening before and after the one line of code you gave us?

That said, a quick glance at your query shows you have an errant trailing comma that shouldn't be there. Remove that comma and your query should work.

04-17-2009, 01:14 AM
Thanks :)

Took the comma out and it worked fine!