Hi,
I've just received the error :
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ''user_id', 'user_active', 'username', 'user_password', 'user_re
which is fair enough - I can normally deal with this - but not this time...
Here's the code :
$sql = "INSERT INTO users ('user_id', 'user_active', 'username', 'user_password', 'user_regdate', 'user_level', 'user_timezone', 'user_style', 'user_lang', 'user_dateformat', 'user_attachsig', 'user_allowhtml', 'user_allowbbcode', 'user_allowsmile', 'user_allowavatar', 'user_allow_pm', 'user_allow_viewonline', 'user_notify', 'user_notify_pm', 'user_popup_pm', 'user_rank', 'user_email', 'user_icq', 'user_website', 'user_from', 'user_sig', 'user_sig_bbcode_uid', 'user_aim', 'user_yim', 'user_msnm', 'user_occ', 'user_interests', 'title', 'firstname', 'surname', 'address1', 'address2', 'town', 'country', 'postcode', 'user_status', 'total_logins', 'signup_ip')
VALUES
('', '1', '" . str_replace("\'", "''", $username) . "', '" . str_replace("\'", "''", $new_password) . "', '" . time() . "', '0', $user_timezone, $user_style, '" . str_replace("\'", "''", $user_lang) . "', '" . str_replace("\'", "''", $user_dateformat) . "', $attachsig, $allowhtml, $allowbbcode, $allowsmilies, '1', '1', $allowviewonline, $notifyreply, $notifypm, $popup_pm, '0', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $signature) . "', $signature_bbcode_uid, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $interests) . "', $title, $firstname, $surname, $address1, $address2, $town, $country, $postcode, 'member', '0', $ip)";
$result = mysql_query($sql) or die(mysql_error());
(i've added spaces in to help you see....)
Here's what i've checked twice.
- the fields and values have the same ammount i.e. 43 in each
- the fields go somewhere sensible i.e. 'username' doesnt go to and autoincrememt number...
- the " and ' and , and the spacing...
I've even had a friend look at it and he cant find anything wrong - please help.
Cheers.
Andy