Multple Forums - 1 Database
Moderator: General Moderators
Multple Forums - 1 Database
I am running phpBB 3 and was wondering if it possible to have just 1 dedicated database for User information?
I have multiple forums and want to have my users only sign up once, and once they do, there user name and password, and all there information will work on all the other forums if not all there information, then just the username and password, and there profile page can be different for each one, don't care... just want them to have to sign up once, and have there user name reserved for all the boards.
Basically to make it a little more simple, what I want the config file to do, is... IF the table phpbb_users is not there, then it will look at the next database to see if it is there, if not THEN give a error.
right now, I inserted the information for the 2nd database in the config file, but now its looking for phpbb_config for a second time. (in the users database)
Thanks in advance.
PS Not sure if this ment to be in PHP or Database forum, so mods please move it if needed. Thanks
I have multiple forums and want to have my users only sign up once, and once they do, there user name and password, and all there information will work on all the other forums if not all there information, then just the username and password, and there profile page can be different for each one, don't care... just want them to have to sign up once, and have there user name reserved for all the boards.
Basically to make it a little more simple, what I want the config file to do, is... IF the table phpbb_users is not there, then it will look at the next database to see if it is there, if not THEN give a error.
right now, I inserted the information for the 2nd database in the config file, but now its looking for phpbb_config for a second time. (in the users database)
Thanks in advance.
PS Not sure if this ment to be in PHP or Database forum, so mods please move it if needed. Thanks
Re: Multple Forums - 1 Database
Its certainly possible however, it would require recoding the login routine for each forum you have active. All you would really need to do is find the login routine for phpbb3 (sorry, I haven't messed with phpbb since version 2 so I can't tell you where it is) and change the sql query to search the database you specify. Either that or if these boards don't have existing users yet then you could rewrite the register routine to update every database with the new signup's info. This way, when a new user signs up there login info is propagated to every board you run.
Re: Multple Forums - 1 Database
cptnwinky wrote:Either that or if these boards don't have existing users yet then you could rewrite the register routine to update every database with the new signup's info. This way, when a new user signs up there login info is propagated to every board you run
Thanks cptnwinky. Well that the good part of all this, the boards have not been launched YET, so there are no users except for me for test reasons, so re-writing the register routine wont be a problem... (really right now, I have only one board and a package I am putting together so that all the other boards are just a simple installation away.)
but NOW does any one have any idea on how I would go about doing this? I mean cause I need it to write to diffrent databases thats why.
Also another option I thought about was, What if I insert all the forums database file within one database using diffrent prefixes like nfl-talk_users, mlb-talk_users, etc.
and then create a table called overallusers_users and edit a php file(s) to read all user information from that database
could that work?
that way all information is in one table, instead of multiple databases.
another question regarding this is, would it put a greater load on my server since databases for maybe 50 or 60 forums are in one database? or would having separate databases for all of them would be better.
Thanks in advance!
Re: Multple Forums - 1 Database
Yep, that could work. As far as putting all the forums in one DB thats just asking for trouble I think. If for some reason data is corrupted you don't want to lose 60 forums worth of information. However, rerouting all signups, registrations and profile updates so that all users are in one table seems reasonable just so that every login isn't querying 60 databases. That would just be nutty.
The best part is I bet that less than 10 lines of code would have to be changed in every installation to accomplish this. If you need any help let me know.
The best part is I bet that less than 10 lines of code would have to be changed in every installation to accomplish this. If you need any help let me know.
Re: Multple Forums - 1 Database
again first off thanks for the help cptnwinky.
Just clear this up a little more...
1) I personally did not like the idea of having 60 forums databases in one database, but was a idea another guy suggested as a idea, and thought I take a hit at it, so as of right now, the idea is out.
2) going back to the original idea of re-routing sign up information and profile information to another place... will the place be a totally different database? cause in your last post you said:
As far as help goes, I will need some help, I am not a expect programmer, but rather just starting out. I will how ever spend most of tomorrow (Sunday) working on this on my own, so please do expect questions.
any any push in the right direction right now would be good.
Just clear this up a little more...
1) I personally did not like the idea of having 60 forums databases in one database, but was a idea another guy suggested as a idea, and thought I take a hit at it, so as of right now, the idea is out.
2) going back to the original idea of re-routing sign up information and profile information to another place... will the place be a totally different database? cause in your last post you said:
so does that mean that it will be just a different table within the nfl-talk database? or did you mean "one [totally new] database"? if you meant a different table within the same database say for example nfl-talk then how would my users be able to goto mlb-talk and sign in there and use that account without having re-register....rerouting all signups, registrations and profile updates so that all users are in one table seems reasonable...
As far as help goes, I will need some help, I am not a expect programmer, but rather just starting out. I will how ever spend most of tomorrow (Sunday) working on this on my own, so please do expect questions.
any any push in the right direction right now would be good.
Re: Multple Forums - 1 Database
I wouldn't use a separate database for just the one users table. Just pick one of the installations to use as the base. I'll be around today to answer questions you may have.
Re: Multple Forums - 1 Database
well after doing some research on the phpbb forum, there is a way to do this, but involved doing the databases for 60 forums into one database, BUT I did take some information away from there installation file. There is not just one table, there is actually 4 or 5 tables. and since I cant predict which forum will be a hit and which one will be a miss, picking one, and using that for my bases, is kinda hard for me, so I decided to do 2 databases. (one strictly for universal user information).
but now...
I know that the script calls on config.php to tell it the database information, but when I insert my information to the users database into the config file under the general database information, it gives a error that it cannot find the config table in the users database.
so basically I need a if tag or something, that says, use this, but if you dont find what you need here, then go to this one. (in php ling. lol)
any thoughts or ideas?
but now...
I know that the script calls on config.php to tell it the database information, but when I insert my information to the users database into the config file under the general database information, it gives a error that it cannot find the config table in the users database.
so basically I need a if tag or something, that says, use this, but if you dont find what you need here, then go to this one. (in php ling. lol)
any thoughts or ideas?
Re: Multple Forums - 1 Database
basically here are the two files I have been messing with...
1) config.php
2) include/constant.php
The reason why theses to, is because in the phpbb mod, theses two files where the ones modded. Now while config.php tells you the database information, contant.php is the one that tells you what everything means, and thats why I need broken down or broken up in, I need for it to say for this, go here.
1) config.php
Code: Select all
<?php
// phpBB 3.0.x auto-generated configuration file
// Do not change anything in this file!
$dbms = 'mysqli';
$dbhost = 'mysql.xxxxx.com';
$dbport = '';
$dbname = 'mydatabase';
$dbuser = 'myusername';
$dbpasswd = 'mypassword';
$table_prefix = 'phpbb_';
$acm_type = 'file';
$load_extensions = '';
@define('PHPBB_INSTALLED', true);
// @define('DEBUG', true);
// @define('DEBUG_EXTRA', true);
?>Code: Select all
<?php
/**
*
* @package phpBB3
* @version $Id: constants.php 8554 2008-05-15 13:29:14Z Kellanved $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* valid external constants:
* PHPBB_MSG_HANDLER
* PHPBB_DB_NEW_LINK
* PHPBB_ROOT_PATH
* PHPBB_ADMIN_PATH
*/
// QA-related
// define('PHPBB_SEO_QA', 1);
// User related
define('ANONYMOUS', 1);
define('USER_ACTIVATION_NONE', 0);
define('USER_ACTIVATION_SELF', 1);
define('USER_ACTIVATION_ADMIN', 2);
define('USER_ACTIVATION_DISABLE', 3);
define('AVATAR_UPLOAD', 1);
define('AVATAR_REMOTE', 2);
define('AVATAR_GALLERY', 3);
define('USER_NORMAL', 0);
define('USER_INACTIVE', 1);
define('USER_IGNORE', 2);
define('USER_FOUNDER', 3);
define('INACTIVE_REGISTER', 1);
define('INACTIVE_PROFILE', 2);
define('INACTIVE_MANUAL', 3);
define('INACTIVE_REMIND', 4);
// ACL
define('ACL_NEVER', 0);
define('ACL_YES', 1);
define('ACL_NO', -1);
// Login error codes
define('LOGIN_CONTINUE', 1);
define('LOGIN_BREAK', 2);
define('LOGIN_SUCCESS', 3);
define('LOGIN_SUCCESS_CREATE_PROFILE', 20);
define('LOGIN_ERROR_USERNAME', 10);
define('LOGIN_ERROR_PASSWORD', 11);
define('LOGIN_ERROR_ACTIVE', 12);
define('LOGIN_ERROR_ATTEMPTS', 13);
define('LOGIN_ERROR_EXTERNAL_AUTH', 14);
define('LOGIN_ERROR_PASSWORD_CONVERT', 15);
// Group settings
define('GROUP_OPEN', 0);
define('GROUP_CLOSED', 1);
define('GROUP_HIDDEN', 2);
define('GROUP_SPECIAL', 3);
define('GROUP_FREE', 4);
// Forum/Topic states
define('FORUM_CAT', 0);
define('FORUM_POST', 1);
define('FORUM_LINK', 2);
define('ITEM_UNLOCKED', 0);
define('ITEM_LOCKED', 1);
define('ITEM_MOVED', 2);
// Forum Flags
define('FORUM_FLAG_LINK_TRACK', 1);
define('FORUM_FLAG_PRUNE_POLL', 2);
define('FORUM_FLAG_PRUNE_ANNOUNCE', 4);
define('FORUM_FLAG_PRUNE_STICKY', 8);
define('FORUM_FLAG_ACTIVE_TOPICS', 16);
define('FORUM_FLAG_POST_REVIEW', 32);
// Optional text flags
define('OPTION_FLAG_BBCODE', 1);
define('OPTION_FLAG_SMILIES', 2);
define('OPTION_FLAG_LINKS', 4);
// Topic types
define('POST_NORMAL', 0);
define('POST_STICKY', 1);
define('POST_ANNOUNCE', 2);
define('POST_GLOBAL', 3);
// Lastread types
define('TRACK_NORMAL', 0);
define('TRACK_POSTED', 1);
// Notify methods
define('NOTIFY_EMAIL', 0);
define('NOTIFY_IM', 1);
define('NOTIFY_BOTH', 2);
// Email Priority Settings
define('MAIL_LOW_PRIORITY', 4);
define('MAIL_NORMAL_PRIORITY', 3);
define('MAIL_HIGH_PRIORITY', 2);
// Log types
define('LOG_ADMIN', 0);
define('LOG_MOD', 1);
define('LOG_CRITICAL', 2);
define('LOG_USERS', 3);
// Private messaging - Do NOT change these values
define('PRIVMSGS_HOLD_BOX', -4);
define('PRIVMSGS_NO_BOX', -3);
define('PRIVMSGS_OUTBOX', -2);
define('PRIVMSGS_SENTBOX', -1);
define('PRIVMSGS_INBOX', 0);
// Full Folder Actions
define('FULL_FOLDER_NONE', -3);
define('FULL_FOLDER_DELETE', -2);
define('FULL_FOLDER_HOLD', -1);
// Download Modes - Attachments
define('INLINE_LINK', 1);
// This mode is only used internally to allow modders extending the attachment functionality
define('PHYSICAL_LINK', 2);
// Confirm types
define('CONFIRM_REG', 1);
define('CONFIRM_LOGIN', 2);
define('CONFIRM_POST', 3);
// Categories - Attachments
define('ATTACHMENT_CATEGORY_NONE', 0);
define('ATTACHMENT_CATEGORY_IMAGE', 1); // Inline Images
define('ATTACHMENT_CATEGORY_WM', 2); // Windows Media Files - Streaming
define('ATTACHMENT_CATEGORY_RM', 3); // Real Media Files - Streaming
define('ATTACHMENT_CATEGORY_THUMB', 4); // Not used within the database, only while displaying posts
define('ATTACHMENT_CATEGORY_FLASH', 5); // Flash/SWF files
define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files
// BBCode UID length
define('BBCODE_UID_LEN', 8);
// Number of core BBCodes
define('NUM_CORE_BBCODES', 12);
// Magic url types
define('MAGIC_URL_EMAIL', 1);
define('MAGIC_URL_FULL', 2);
define('MAGIC_URL_LOCAL', 3);
define('MAGIC_URL_WWW', 4);
// Profile Field Types
define('FIELD_INT', 1);
define('FIELD_STRING', 2);
define('FIELD_TEXT', 3);
define('FIELD_BOOL', 4);
define('FIELD_DROPDOWN', 5);
define('FIELD_DATE', 6);
// referer validation
define('REFERER_VALIDATE_NONE', 0);
define('REFERER_VALIDATE_HOST', 1);
define('REFERER_VALIDATE_PATH', 2);
// Additional constants
define('VOTE_CONVERTED', 127);
// Table names
define('ACL_GROUPS_TABLE', $table_prefix . 'acl_groups');
define('ACL_OPTIONS_TABLE', $table_prefix . 'acl_options');
define('ACL_ROLES_DATA_TABLE', $table_prefix . 'acl_roles_data');
define('ACL_ROLES_TABLE', $table_prefix . 'acl_roles');
define('ACL_USERS_TABLE', $table_prefix . 'acl_users');
define('ATTACHMENTS_TABLE', $table_prefix . 'attachments');
define('BANLIST_TABLE', $table_prefix . 'banlist');
define('BBCODES_TABLE', $table_prefix . 'bbcodes');
define('BOOKMARKS_TABLE', $table_prefix . 'bookmarks');
define('BOTS_TABLE', $table_prefix . 'bots');
define('CONFIG_TABLE', $table_prefix . 'config');
define('CONFIRM_TABLE', $table_prefix . 'confirm');
define('DISALLOW_TABLE', $table_prefix . 'disallow');
define('DRAFTS_TABLE', $table_prefix . 'drafts');
define('EXTENSIONS_TABLE', $table_prefix . 'extensions');
define('EXTENSION_GROUPS_TABLE', $table_prefix . 'extension_groups');
define('FORUMS_TABLE', $table_prefix . 'forums');
define('FORUMS_ACCESS_TABLE', $table_prefix . 'forums_access');
define('FORUMS_TRACK_TABLE', $table_prefix . 'forums_track');
define('FORUMS_WATCH_TABLE', $table_prefix . 'forums_watch');
define('GROUPS_TABLE', $table_prefix . 'groups');
define('ICONS_TABLE', $table_prefix . 'icons');
define('LANG_TABLE', $table_prefix . 'lang');
define('LOG_TABLE', $table_prefix . 'log');
define('MODERATOR_CACHE_TABLE', $table_prefix . 'moderator_cache');
define('MODULES_TABLE', $table_prefix . 'modules');
define('POLL_OPTIONS_TABLE', $table_prefix . 'poll_options');
define('POLL_VOTES_TABLE', $table_prefix . 'poll_votes');
define('POSTS_TABLE', $table_prefix . 'posts');
define('PRIVMSGS_TABLE', $table_prefix . 'privmsgs');
define('PRIVMSGS_FOLDER_TABLE', $table_prefix . 'privmsgs_folder');
define('PRIVMSGS_RULES_TABLE', $table_prefix . 'privmsgs_rules');
define('PRIVMSGS_TO_TABLE', $table_prefix . 'privmsgs_to');
define('PROFILE_FIELDS_TABLE', $table_prefix . 'profile_fields');
define('PROFILE_FIELDS_DATA_TABLE', $table_prefix . 'profile_fields_data');
define('PROFILE_FIELDS_LANG_TABLE', $table_prefix . 'profile_fields_lang');
define('PROFILE_LANG_TABLE', $table_prefix . 'profile_lang');
define('RANKS_TABLE', $table_prefix . 'ranks');
define('REPORTS_TABLE', $table_prefix . 'reports');
define('REPORTS_REASONS_TABLE', $table_prefix . 'reports_reasons');
define('SEARCH_RESULTS_TABLE', $table_prefix . 'search_results');
define('SEARCH_WORDLIST_TABLE', $table_prefix . 'search_wordlist');
define('SEARCH_WORDMATCH_TABLE', $table_prefix . 'search_wordmatch');
define('SESSIONS_TABLE', $table_prefix . 'sessions');
define('SESSIONS_KEYS_TABLE', $table_prefix . 'sessions_keys');
define('SITELIST_TABLE', $table_prefix . 'sitelist');
define('SMILIES_TABLE', $table_prefix . 'smilies');
define('STYLES_TABLE', $table_prefix . 'styles');
define('STYLES_TEMPLATE_TABLE', $table_prefix . 'styles_template');
define('STYLES_TEMPLATE_DATA_TABLE',$table_prefix . 'styles_template_data');
define('STYLES_THEME_TABLE', $table_prefix . 'styles_theme');
define('STYLES_IMAGESET_TABLE', $table_prefix . 'styles_imageset');
define('STYLES_IMAGESET_DATA_TABLE',$table_prefix . 'styles_imageset_data');
define('TOPICS_TABLE', $table_prefix . 'topics');
define('TOPICS_POSTED_TABLE', $table_prefix . 'topics_posted');
define('TOPICS_TRACK_TABLE', $table_prefix . 'topics_track');
define('TOPICS_WATCH_TABLE', $table_prefix . 'topics_watch');
define('USER_GROUP_TABLE', $table_prefix . 'user_group');
define('USERS_TABLE', $table_prefix . 'users');
define('WARNINGS_TABLE', $table_prefix . 'warnings');
define('WORDS_TABLE', $table_prefix . 'words');
define('ZEBRA_TABLE', $table_prefix . 'zebra');
// Additional tables
// Advertisement Management
define('ADS_TABLE', $table_prefix . 'ads');
define('ADS_FORUMS_TABLE', $table_prefix . 'ads_forums');
define('ADS_GROUPS_TABLE', $table_prefix . 'ads_groups');
define('ADS_IN_POSITIONS_TABLE', $table_prefix . 'ads_in_positions');
define('ADS_POSITIONS_TABLE', $table_prefix . 'ads_positions');
?>Re: Multple Forums - 1 Database
I'm going to download phpbb3 and examine it myself. I'll post back if I make a breakthrough.
Re: Multple Forums - 1 Database
Thank you, I really do appreciate it!cptnwinky wrote:I'm going to download phpbb3 and examine it myself. I'll post back if I make a breakthrough.
I am still messing around with it too, so will post back if I find anything too.
Re: Multple Forums - 1 Database
I found that someone has already made a mod to do this but it's really hard to understand due to a language barrier and lack of proper instructions.
http://www.phpbb.com/community/viewtopi ... 0&t=559423
May be worth checking out though.
http://www.phpbb.com/community/viewtopi ... 0&t=559423
May be worth checking out though.
Re: Multple Forums - 1 Database
already checked it out. and keep it as a backup, basically thats the same idea as the other one,
all forums are loaded into one database (so about 60 forums on one database using different prefixes) and then you have 3 or 4 tables called overall or something. and have contribute.php look at those tables instead of the one needed.
Like I said I am planning on keeping this as a back up, if no solution is found. But again, the only problem lie within that fact that if something happens to the one forum database, then may cause all my forums to go down...
all forums are loaded into one database (so about 60 forums on one database using different prefixes) and then you have 3 or 4 tables called overall or something. and have contribute.php look at those tables instead of the one needed.
Like I said I am planning on keeping this as a back up, if no solution is found. But again, the only problem lie within that fact that if something happens to the one forum database, then may cause all my forums to go down...
Re: Multple Forums - 1 Database
another thought is, is it possible to backup data from one database to another on the same server.
Like if a user enter his information in the database for NFL talk, then maybe with a corn job or something, every 24 hours, it updates that information to another dedicated user database, that way while the information is updated instantly on the forum he or she is using, within 24 hours, all of them would be updated too.
Like if a user enter his information in the database for NFL talk, then maybe with a corn job or something, every 24 hours, it updates that information to another dedicated user database, that way while the information is updated instantly on the forum he or she is using, within 24 hours, all of them would be updated too.
Re: Multple Forums - 1 Database
That's not a half bad idea. It would certainly be much simpler to implement. I've started writing a script to handle this replication. Give me till about tomorrow.
One thing to think about too is whether or not you want to include various other profile information and also replicate the users avatars, etc.
An area of this that I'm worried about is handling cookies and sessions but we'll see if that causes a problem when we get there.
One thing to think about too is whether or not you want to include various other profile information and also replicate the users avatars, etc.
An area of this that I'm worried about is handling cookies and sessions but we'll see if that causes a problem when we get there.
Re: Multple Forums - 1 Database
I've got some code going but I'm stuck. For some reason the query on line 41 is only producing one user when there are several in the database. The weird thing is I can take that same query and put in a hard coded timestamp and run it through phpmyadmin and it produces the desired result, several users are returned.
I think overall I am overlooking something fundamental because even if it's one user returned it shouldn't be returning what it is (as you'll see below). If you pay attention to my debugging stuff (just some echos and print_r's) you'll see what I am expecting to return however, when this one record comes back the foreach loop on line 50 splits the single array into each key value pair being it's own array. Which is not the desired result.
So hopefully either you or someone else passing by this thread could help me out. Whoever does, just keep in mind that the code above isn't finished and if you use it on your system I'm not responsible for any loss or damage it may cause.
I think overall I am overlooking something fundamental because even if it's one user returned it shouldn't be returning what it is (as you'll see below). If you pay attention to my debugging stuff (just some echos and print_r's) you'll see what I am expecting to return however, when this one record comes back the foreach loop on line 50 splits the single array into each key value pair being it's own array. Which is not the desired result.
Code: Select all
<?php
$dbArray = array(
array('id' => 0,
'host' => 'localhost',
'user' => 'root',
'pass' => '',
'db' => 'forum1',
'users_table' => '1_users'
),
array('id' => 1,
'host' => 'localhost',
'user' => 'root',
'pass' => '',
'db' => 'forum2',
'users_table' => '2_users'
)
);
// to keep track of which array index were on
$i = 0;
// Loop through our array of databases
foreach($dbArray as $item) {
// Set up the database connection
$dbConn1 = new mysqli($item['host'], $item['user'], $item['pass'], $item['db']);
if($dbConn1->connect_error) {
// TODO: handle this error gracefully
// by logging it to a file and
// moving on to the next db.
// This continue is temporary.
continue;
}else{
// Get the last users signup timestamp
$timestamp = file_get_contents('timestamp.txt');
//echo $timestamp;
//echo $item['users_table'];
// grab all the new users since last run
$result = $dbConn1->query("SELECT * FROM `$item[users_table]` WHERE `user_regdate` > '$timestamp'");
if($fetch = $result->fetch_assoc()) {
echo '<pre>';
print_r($fetch);
echo '</pre>';
// We've got them lets send them to every other db
foreach($fetch as $users) {
echo '<pre>';
print_r($users);
echo '</pre>';
// Loop over every database but the one who's
// index were on and insert the user info.
foreach($dbArray as $db) {
// check to make sure this is the current db
// from our parent loop.
if($db['id'] = $i) {
continue;
}else{
// create a new database connection
$dbConn2 = new mysqli($db['host'], $db['user'], $db['pass'], $db['db']);
if($dbConn2->connect_error) {
// TODO: handle this error gracefully
// by logging it to a file and
// moving on to the next db.
// This continue is temporary.
continue;
}else{
if($dbConn2->query("INSERT INTO $db[users_table]
(`user_type`,
`group_id`,
`user_permissions`,
`user_perm_from`,
`user_ip`,
`user_regdate`,
`username`,
`username_clean`,
`user_password`,
`user_passchg`,
`user_pass_convert`,
`user_email`,
`user_email_hash`,
`user_birthday`,
`user_inactive_reason`,
`user_inactive_time`,
`user_lang`,
`user_timezone`,
`user_dst`,
`user_dateformat`,
`user_message_rules`,
`user_emailtime`,
`user_topic_show_days`,
`user_topic_sortby_type`,
`user_topic_sortby_dir`,
`user_post_show_days`,
`user_post_sortby_type`,
`user_post_sortby_dir`,
`user_notify`,
`user_notify_pm`,
`user_notify_type`,
`user_allow_pm`,
`user_allow_viewonline`,
`user_allow_viewemail`,
`user_allow_massemail`,
`user_options`,
`user_from`,
`user_icq`,
`user_aim`,
`user_yim`,
`user_msnm`,
`user_jabber`,
`user_website`,
`user_occ`,
`user_interests`,
`user_actkey`,
`user_newpasswd`,
`user_form_salt`
)
VALUES ('$users[user_type]',
'$users[group_id]',
'$users[user_permissions]',
'$users[user_perm_from]',
'$users[user_ip]',
'$users[user_regdate]',
'$users[username]',
'$users[username_clean]',
'$users[user_password],
'$users[user_passchg]',
'$users[user_pass_convert]',
'$users[user_email]',
'$users[user_email_hash]',
'$users[user_birthday]',
'$users[user_inactive_reason]',
'$users[user_inactive_time]',
'$users[user_lang]',
'$users[user_timezone]',
'$users[user_dst]',
'$users[user_dateformat]',
'$users[user_message_rules]',
'$users[user_emailtime]',
'$users[user_topic_show_days]',
'$users[user_topic_sortby_type]',
'$users[user_topic_sortby_dir]',
'$users[user_post_show_days]',
'$users[user_post_sortby_type]',
'$users[user_post_sortby_dir]',
'$users[user_notify]',
'$users[user_notify_pm]',
'$users[user_notify_type]',
'$users[user_allow_pm]',
'$users[user_allow_viewonline]',
'$users[user_allow_viewemail]',
'$users[user_allow_massemail]',
'$users[user_options]',
'$users[user_from]',
'$users[user_icq]',
'$users[user_aim]',
'$users[user_yim]',
'$users[user_msnm]',
'$users[user_jabber]',
'$users[user_website]',
'$users[user_occ]',
'$users[user_interests]',
'$users[user_actkey]',
'$users[user_newpasswd]',
'$users[user_form_salt]')"))
{
// The insert was succesful update the timestamp file
// with the last users reg date.
file_put_contents('timestamp.txt', $users['users_regdate']);
continue;
}else{
// TODO: handle this error gracefully
// by logging it to a file and
// moving on to the next db.
// This continue is temporary.
continue;
}
}
}
}
}
}else{
echo 'error';
continue;
}
}
$i++;
$dbConn1->close();
}
?>
Code: Select all
Array
(
[user_id] => 1
[user_type] => 2
[group_id] => 1
[user_permissions] =>
[user_perm_from] => 0
[user_ip] =>
[user_regdate] => 1230523953
[username] => Anonymous
[username_clean] => anonymous
[user_password] =>
[user_passchg] => 0
[user_pass_convert] => 0
[user_email] =>
[user_email_hash] => 0
[user_birthday] =>
[user_lastvisit] => 0
[user_lastmark] => 0
[user_lastpost_time] => 0
[user_lastpage] =>
[user_last_confirm_key] =>
[user_last_search] => 0
[user_warnings] => 0
[user_last_warning] => 0
[user_login_attempts] => 0
[user_inactive_reason] => 0
[user_inactive_time] => 0
[user_posts] => 0
[user_lang] => en
[user_timezone] => 0.00
[user_dst] => 0
[user_dateformat] => d M Y H:i
[user_style] => 1
[user_rank] => 0
[user_colour] =>
[user_new_privmsg] => 0
[user_unread_privmsg] => 0
[user_last_privmsg] => 0
[user_message_rules] => 0
[user_full_folder] => -3
[user_emailtime] => 0
[user_topic_show_days] => 0
[user_topic_sortby_type] => t
[user_topic_sortby_dir] => d
[user_post_show_days] => 0
[user_post_sortby_type] => t
[user_post_sortby_dir] => a
[user_notify] => 0
[user_notify_pm] => 1
[user_notify_type] => 0
[user_allow_pm] => 1
[user_allow_viewonline] => 1
[user_allow_viewemail] => 1
[user_allow_massemail] => 0
[user_options] => 895
[user_avatar] =>
[user_avatar_type] => 0
[user_avatar_width] => 0
[user_avatar_height] => 0
[user_sig] =>
[user_sig_bbcode_uid] =>
[user_sig_bbcode_bitfield] =>
[user_from] =>
[user_icq] =>
[user_aim] =>
[user_yim] =>
[user_msnm] =>
[user_jabber] =>
[user_website] =>
[user_occ] =>
[user_interests] =>
[user_actkey] =>
[user_newpasswd] =>
[user_form_salt] => c43cef2ad73bbec7
)
1
2
1
0
1230523953
Anonymous
anonymous
0
0
0
0
0
0
0
0
0
0
0
0
0
en
0.00
0
d M Y H:i
1
0
0
0
0
0
-3
0
0
t
d
0
t
a
0
1
0
1
1
1
0
895
0
0
0
c43cef2ad73bbec7
error