|
|
| Author |
Message |
Hatz
Not So New User
Joined: 23 Mar 2007
Posts: 38
|
Posted: November 11th 2007, 3:39 am Post subject: Could not insert data into users table "usercp_register |
|
|
Dont know when it started, just noticed it and a repair to sql db didnt fix so it's script error. If anyone can see what i did wrong, please help. Thank you.
Recently added mods that had me edit usercp_register i think would be only the klass mod. So maybe "klass" has something to do with this, though the mod works fine for users already registered.
Could not insert data into users table
DEBUG MODE
INSERT INTO phpbb_auto_users (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_rankset_id, user_dateformat, user_lang, user_style, user_klass, user_level, user_allow_pm, user_active, user_actkey) VALUES (169, 'sfdfasdjh', 1194772560, 'd0af05ff96d134266c532164e608efff', 'dsfdsdas@hotmail.com', '', '', '', '', '', '', '', '', 0, 0, '', '', '', 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 'D M d, Y g:i a', 'english', 3, 0, 1, '0' 1, '')
Line : 993
File : usercp_register.php
| Code:
|
//
// Get current date
//
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_rankset_id, user_dateformat, user_lang, user_style, user_klass, user_level, user_allow_pm, user_active, user_actkey)
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, $rankset, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, '$klass' ";
if ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN || $coppa )
|
|
|
| Back to top |
|
 |
~HG~
Dedicated User
Joined: 08 Nov 2003
Posts: 3913
Location: Australia
|
|
| Back to top |
|
 |
Hatz
Not So New User
Joined: 23 Mar 2007
Posts: 38
|
Posted: November 11th 2007, 3:20 pm Post subject: |
|
|
| fixed, was missing a , after the klass....not sure why i needed it cuz there is nothing after it, but it fixed it, thanks for your help though |
|
| Back to top |
|
 |
CR
New User
Joined: 07 Dec 2009
Posts: 11
|
Posted: December 7th 2009, 8:08 pm Post subject: |
|
|
Hi, I also seem to have the same/simlar error
Please someone help as I have sat and gone over the same section of code for what now feels like days....
Here is my error message:
| Quote:
|
General Error
Could not insert data into users table
DEBUG MODE
INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_birthday, user_next_birthday_greeting, user_active, user_actkey) VALUES (8, 'qwerty', 1260237380, 'c3981fa8d26e95d911fe8eaeb6570f2f', 'dfgdf@gdfg.com', '', '', '', '', '', '', '', '', 0, 0, '', '', '', 1, 1, 0, 1, 1, 0, 1, 1, 0, 'D M d Y g:i a', 'english', 2, 0, 1, '3090', '2010', 1, '')
Line : 712
File : usercp_register.php
|
And my code from usercp_register:
| Code:
|
//
// Get current date
//
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_birthday, user_next_birthday_greeting, user_active, user_actkey)
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, '$birthday', '$next_birthday_greeting', ";
if ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN || $coppa )
|
|
|
| Back to top |
|
 |
~HG~
Dedicated User
Joined: 08 Nov 2003
Posts: 3913
Location: Australia
|
Posted: December 8th 2009, 1:51 pm Post subject: |
|
|
It appears to me that you have not made the necessary edits required for the hack to work.
I suggest you read the instructions carefully and ensure you have done everything required. _________________ ~HG~
|| rodneyangell.com || || phpbb-tutorials.com ||My Hacks |
|
| Back to top |
|
 |
CR
New User
Joined: 07 Dec 2009
Posts: 11
|
Posted: December 8th 2009, 6:03 pm Post subject: |
|
|
The worst part is that I have no idea what hack it is that has failed. Allow me to explain.
I install each hack manually and test everything - once I'm sure there are no errors I back up the entire phpbb2 folder and also export the mysql dadabase out from phpmyadmin and begin work on the next mod.
Now the problem is that everything was working fine and all I have altered is the CSS and layout of some sections (nothing to do with the database and only made changes to some .tpl files).
Then when attempting to register a new user I got the above error... I have even gone back to an old backup including the database and the error is still there.... So, my question is - what could I have poss done to cause this and why after reverting to a previous known working backup does it still not work...?
Now you see why I'm lost...
P.S.
Thank you for you previous fast reply Just glad some folk still use phpBB2 after all this time |
|
| Back to top |
|
 |
cq92
New User
Joined: 14 Apr 2010
Posts: 1
|
Posted: April 14th 2010, 3:46 pm Post subject: Solution for Cannot insert data into users table PhpBB2 |
|
|
If using MySQL version 5.1 the problem will occur on registration that user data cannot be inserted into a table. (Windows Servers)
The problem is caused due to MySQL server has been configured with the "use strict" option for compatability with older MySQL versions.
Simply re-run the SQL configuration wizard with the "use strict" option unchecked and the error will disappear and registration will work perfectly.
It would appear that due to the way the script is written the SQL servr cannot properly interpret the "insert" command when strict is used.
If you do not have access to reconfiguring the SQL server then the insert data commands would have to be re-written in the PHP register pages to comply with the "strict" configuration parameters to make them work. |
|
| Back to top |
|
 |
|