phpBBHacks.com - Could not insert data into users table "usercp_register
phpBBHacks.com, the place for phpBB users
StatsForums Home   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in
FAQFAQ   SearchSearch   MemberlistMemberlist   TutorialsTutorials   ContactContact Us
Username:    Password:
Remember Me?    
   I Lost My Password!
Bookmark and Share
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2 Hack Support
 See a User Guidelines violation? Please contact us.
Author Message

Hatz
Not So New User

Joined: 23 Mar 2007
Posts: 38

PostPosted: November 11th 2007, 3:39 am    Post subject: Could not insert data into users table "usercp_register Reply with quote

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
View user's profile Send private message

~HG~
Dedicated User

Joined: 08 Nov 2003
Posts: 3913
Location: Australia

PostPosted: November 11th 2007, 12:43 pm    Post subject: Reply with quote

Try replacing '$klass' "; with $klass "; and see if that works.
_________________
~HG~

|| rodneyangell.com || || phpbb-tutorials.com ||My Hacks
Back to top
View user's profile Send private message Send e-mail Visit poster's website

Hatz
Not So New User

Joined: 23 Mar 2007
Posts: 38

PostPosted: November 11th 2007, 3:20 pm    Post subject: Reply with quote

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
View user's profile Send private message

CR
New User

Joined: 07 Dec 2009
Posts: 11

PostPosted: December 7th 2009, 8:08 pm    Post subject: Reply with quote

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
View user's profile Send private message

~HG~
Dedicated User

Joined: 08 Nov 2003
Posts: 3913
Location: Australia

PostPosted: December 8th 2009, 1:51 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website

CR
New User

Joined: 07 Dec 2009
Posts: 11

PostPosted: December 8th 2009, 6:03 pm    Post subject: Reply with quote

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
View user's profile Send private message

cq92
New User

Joined: 14 Apr 2010
Posts: 1

PostPosted: April 14th 2010, 3:46 pm    Post subject: Solution for Cannot insert data into users table PhpBB2 Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> phpBB 2 Hack Support All times are GMT - 6 Hours
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Big Message Boards - Free JavaScript - phpBB2 - phpbb styles - Suporte phpBB - phpBB Česky - phpBB Turkiye - phpBBArabia.com - phpBB-fr.com - Romanian phpBB online community - phpBB-TW.net - phpBBservice.nl - phpBB Brasil - phpBB Portugal - phpBBpersian.com

Network: iFroggy Hosting - PhotoshopForums.com - Managing Online Forums - ManagingCommunities.com - CommunityAdmins.com - KarateForums.com - Bad Boy Blog - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact Us - Disclosure Policy - Staff - User Guidelines >

Copyright © 2001-2012. iFroggy Network, phpBBHacks.com. All Rights Reserved. Privacy Policy. We Support phpBBHacks.com (of course!).
Powered by phpBB © phpBB Group. phpBB SEO. We are in no way affiliated with the phpBB Group. phpBB is copyright to the phpBB Group.