|
|
|
||||
|
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
Confirmed User
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
|
Mysql expert needed...
does anyone know how to merge to tables? Table1_members needs to receive all the fields and setting in Table2_users. anyone know hwo to do this merge either via shell or phpmyadmin
|
|
|
|
|
|
#2 |
|
Confirmed User
Join Date: Nov 2005
Posts: 647
|
are the tables identical?
__________________
money talks and bullshit walks. |
|
|
|
|
|
#3 |
|
Confirmed User
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
|
no not identical. they're both in the same database though. one is rate_members and the other is phpbb_users. i need all the fields with there settings from phpbb_users (with the exception of username and user_id, i'll drop those fields) moved/copied to rate_members.
i've check both tables and there won't be a overlapping problem since all fields in phpbb_users are unique |
|
|
|
|
|
#4 |
|
Confirmed User
Join Date: Nov 2005
Posts: 647
|
you can try something like this
INSERT INTO rate_members (field1,field2,field3) SELECT field1,field2,field3 FROM phpbb_users
__________________
money talks and bullshit walks. |
|
|
|
|
|
#5 |
|
Join Date: Mar 2005
Location: LA
Posts: 4,920
|
the way we would do it is first create a duplicate of the destination via phpmyadmin (operations>copy table with data/structure) then write a simple php script to read the one you want to merge, and as you loop thru the results, import to the duplicate version passing only the variables that are required to make the entry valid in the copy. Once you confirm the data is correct, u can rename the tables via the same way (operations>rename) and make it live without any hiccups.
__________________
Promote ONE Legal Tube Site, Collect Checks from 19 Sponsors ![]() Fresh Dave | Email: [email protected] | ICQ: 317160390 |
|
|
|
|
|
#6 | |
|
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
Quote:
|
|
|
|
|
|
|
#7 |
|
Confirmed User
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
|
ok i'll try the php script version, i know enough php to do something small like that. thanks
|
|
|
|
|
|
#8 |
|
Confirmed User
Join Date: Oct 2003
Location: Atlanta
Posts: 2,840
|
i did some research looks like i need to use ALTER to add to an existing table
ALTER TABLE table_name ADD column_name datatype |
|
|
|
|
|
#9 | |
|
Confirmed User
Join Date: Nov 2005
Posts: 647
|
Quote:
__________________
money talks and bullshit walks. |
|
|
|
|
|
|
#10 | |
|
Confirmed User
Join Date: Dec 2001
Location: Malibu
Posts: 3,817
|
Quote:
|
|
|
|
|
|
|
#11 | |
|
Confirmed User
Join Date: Nov 2005
Posts: 647
|
Quote:
__________________
money talks and bullshit walks. |
|
|
|
|
|
|
#12 |
|
Confirmed User
Industry Role:
Join Date: Feb 2004
Location: Tampa yomebe -at- hotmail
Posts: 3,980
|
expertSEXchange.com hehe
|
|
|
|
|
|
#13 |
|
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 3,108
|
The real question here is: why in gods name do you want to do that?!
Either learn how to do joins, or if you use mysql 5, setup a damn view.
__________________
"Think about it a little more and you'll agree with me, because you're smart and I'm right." - Charlie Munger |
|
|
|
|
|
#14 | |
|
Join Date: Mar 2005
Location: LA
Posts: 4,920
|
Quote:
the safest way of going about it is as i described.
__________________
Promote ONE Legal Tube Site, Collect Checks from 19 Sponsors ![]() Fresh Dave | Email: [email protected] | ICQ: 317160390 |
|
|
|
|