PDA

View Full Version : Integrating 2 Mysql Databases help



XeonGX
March 30th, 2007, 21:35
Hello people,
I had a phpbb forum with about 3000 members,
And now i've re-opened my site, using a member script,
I do not want to use the phpbb forum anymore, but I want all the member information from the phpbb database into my memberscipt database,
Note: Memberscript is custom made.

and the user table in the member script looks like this:

user_id username password email_address type registered_on posts

the important rows are
user_id username password email_address type registered_on
user_id is the user's id,
and the password is md5 i think.
the type should be 1 for all the imported info, and registered on is the date for the registeration. ex. 1173802161 = March 18,2007

is this possible?
please help :) if u can

krakjoe
March 31st, 2007, 10:33
not home right now, but are you sure you can use the same password mechanism that phpBB uses, I have no idea what that is but before I write the code to convery the DB, I reckon it'll be worth checking on else we're just wasting time.

no reason it can't be done ( other than ^^ ) ..... I'll come back later and check.

themoose
March 31st, 2007, 10:47
Do you have the table structure of the phpBB users row?

XeonGX
March 31st, 2007, 11:13
its reguler phpbb forum

i'll check the user table and give it to you



user_id username user_password user_regdate user_posts
only those fields to these ones

user_id username password email_address type registered_on posts
the user type should be 1 for all members

and for the password, the memberscript uses md5 i think
example : 5932da10a05851ee2fef017e5c859e39

themoose
March 31st, 2007, 12:00
Ok connect to the phpbb forum and run this



$query = mysql_query("SELECT user_id,username,user_password,user_regdate,user_posts FROM `users_table`");

while($row = mysql_fetch_array($query, MYSQL_ASSOC)) {
echo "INSERT INTO `new_table` (`user_id`, `username`, `password`, `email_address`, `type`, `registered_on`, `posts`) VALUES ('$row[user_id]', '$row[username]', '$row[user_password]', '1', '$row[user_regdate]', '$row[user_posts]'); <br />\n";
}

I'm not sure if the user_id is autoincrement, if it is i'd take out "$row[user_id]" so it's just '', at that part.

Of course edit the `users_table` and `new_table` to the respective table names.

Running that script should display a page of SQL imports, copy all and save it as a .txt or .sql file. Then log into the new phpMyAdmin and import the file.

Let us know if you have any questions :).

Colin

XeonGX
March 31st, 2007, 12:08
the id is auto increasment,
when user signs up, it'll increase by it self.

so i should open phpmyadmin
then go to the phpbb database
and click on sql
and copy that code in the field
and change new_table to members_users?
then it will copy the database files into member_users?

btw: members is member scripts database, and users is the name of the table that the fields are in.

themoose
March 31st, 2007, 12:11
No, you want to import this into the new table, the new script. Once you've run the script forget about phpBB :).

XeonGX
March 31st, 2007, 12:14
this sounds very simple
but im facing lots of problems.
colin can u do this if i give u my cpanel access for few minutes?
plz?

themoose
March 31st, 2007, 12:17
this sounds very simple
but im facing lots of problems.
colin can u do this if i give u my cpanel access for few minutes?
plz?

I'll try, PM me.

XeonGX
March 31st, 2007, 12:34
k pm sent awhile ago
lmk when ur done :)
thanks for helping

redboyke
April 9th, 2007, 05:15
it will not work i think cause how will u check the pass? example

i dont know how phpBB encrypts it password but lets say its salt(md5($password))

and your script is using md5($password)

when u will check a password u will check md5($password) against salt(md5($password))

and all members of the phpBB will get an error that password is wrong
u need to look how phpbb encrypts the password

easiest way is to tell your members that u are merging databasses and send them a new link to make new password to activate their account.