|
|
#1 (permalink) |
|
Honorary Member
Join Date: Aug 2006
Location: Sydney, Australia
Age: 24
Posts: 1,406
Rep Power: 4
|
Hi GG nerd division,
I've dabbled in SQL stuff before, but mainly getting stuff - not changing stuff. I'm trying to merge 2 phpBB3 forums together. I'm pretty sure I've got the logic down, now I just need to make it happen. Here is what I've got so far: UPDATE database2.phpbb_groups SET group_id = group_id + SELECT MAX(group_id) FROM database1.phpbb_groups The bold bit is wrong. The SELECT MAX statement works on it own, and if you replace the bold statement with a number, it works...but they don't work together at all. The idea is, I'm trying to get all the unique ID's in database 2 to increment past the max ID in database 1. Then I've got another seperate script to merge the 2 together. Any ideas would be really appreciated. Thanks!
__________________
clan ohnd Pierre: A father-obsessed singer and dancer who appears in various instructional videos teaching children how to dance to hip-hop and meditate, while expressing his desire to meet their dad. |
|
|
|
|
|
|
|
#2 (permalink) |
|
GotGames Admin
Join Date: Sep 2007
Location: Sydney, Australia
Posts: 3,429
gXboxLive Leaderboard: 102nd
Rep Power: 5
|
|
|
|
|
|
|
#4 (permalink) |
|
Honorary Member
Join Date: Aug 2006
Location: Sydney, Australia
Age: 24
Posts: 1,406
Rep Power: 4
|
good point nuk3.
basically, it gives me that awesome error along the lines of: YOU HAVE DONE A BAD. READ THE DOCUMENTATION TO SEE WHY YOU ARE A NOOB. Nothing is altered. I really want to get it done tonight, so I've just gone though and got all the max values manually and am now making a query to update from those numbers. Sorry it was all a bit vauge, but I think I'm ok from now on. If anyone wants to tell me how to do it better next time though, I'll all for the learnings.
__________________
clan ohnd Pierre: A father-obsessed singer and dancer who appears in various instructional videos teaching children how to dance to hip-hop and meditate, while expressing his desire to meet their dad. |
|
|
|
|
|
#5 (permalink) |
|
Pro Member
Join Date: May 2006
Location: Sydney, Australia
Posts: 6,539
Rep Power: 9
|
It's probably something silly like there being no brackets around the subquery:
UPDATE database2.phpbb_groups SET group_id = group_id + (SELECT MAX(group_id) FROM database1.phpbb_groups) The error would tell you what's wrong, but as you said, it doesn't matter now.
__________________
OM NOM NOM |
|
|
|
|
|
#6 (permalink) |
|
Honorary Member
Join Date: Aug 2006
Location: Sydney, Australia
Age: 24
Posts: 1,406
Rep Power: 4
|
For anyone interested, I ended up getting it done.
But be aware if you want to do something similar, it was 15 hours worth of manual SQL editing and trial and error. There is no easy 3 click step merge scripts available for phpBB3...yet...and probably wont be for a long time.
__________________
clan ohnd Pierre: A father-obsessed singer and dancer who appears in various instructional videos teaching children how to dance to hip-hop and meditate, while expressing his desire to meet their dad. |
|
|
|
|
|
#7 (permalink) |
|
Contributing Member
Join Date: Jun 2006
Posts: 607
Rep Power: 3
|
Your error was probably something to do with table level locking.
__________________
92% of teens have moved on to rap. If you are part of the 8% who still listen to real music, copy and paste this into your signature. |
|
|
|
|
|
#12 (permalink) |
|
GotGames Moderator
Join Date: Aug 2006
Location: brisbane
Posts: 6,023
Rep Power: 9
|
__________________
![]() Find me at: #gotgames @ gamesurge esjay ~ scoTT ~ ~ joeL ~ osprey_ ~ khooy ~ defi|er ~ pudge ~ KEGGGy ~ kotso ~Manji ~ dNb ~ Constance_ ~ aceh ~ subnOize ~ smiterz Handsome gentleman crew
(club closed - must be a gentleman and a handsome) |
|
|
|
|
|
#14 (permalink) |
|
GotGames Moderator
Join Date: Aug 2006
Location: brisbane
Posts: 6,023
Rep Power: 9
|
SOUNDS LIKE IM GOING TO NEED A FEW INTERACTION DIAGRAMS ASWELL!!!!
__________________
![]() Find me at: #gotgames @ gamesurge esjay ~ scoTT ~ ~ joeL ~ osprey_ ~ khooy ~ defi|er ~ pudge ~ KEGGGy ~ kotso ~Manji ~ dNb ~ Constance_ ~ aceh ~ subnOize ~ smiterz Handsome gentleman crew
(club closed - must be a gentleman and a handsome) |
|
|
|







