Page is a not externally linkable
- Code, Content, and Presentation
-- PHP Server Side Scripting
---- Comparing Large Databases?


AhmedF - 8:53 am on Mar 6, 2004 (gmt 0)


I have 2 MySQL databases, and each has a user table, one with 7000 rows (TABLE A) and another with 2000 rows (TABLE B)approx.
I'm trying to combine the 2000 with the 7000 in one big user table and remove the duplicates.

First I insert each user table into a multidimensional array and compare each row of TABLE A with all the rows of TABLE B through a FOR statement.

So it loops about 7000 x 2000 = 14000000 times. A bit too much if you ask me and it always times out, so I was wondering if any body had any ideas on any more effecient ways to do it.

An idea I had was a big table join but theyre in different DB's so that wouldnt work. Anyone? :)


Thread source:: http://www.webmasterworld.com/php/3098.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com