GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 25-Jan-2007, 09:03
meurer meurer is offline
New Member
 
Join Date: Jan 2007
Posts: 2
meurer is on a distinguished road

Moving data from MySQL to MySQL


QUICK EXPLANATION: I'm looking for a way to check each record in result from MySQL Server 1 (MySQL1) quickly against those already in MySQL Server 2 (MySQL2) and make decisions on whether to keep them or not based on business rules.

DETAILED EXPLANATION:
I am building a PHP script to move data from a MySQL database on one server (MySQL1) to a MySQL Instance on a different server (MySQL2).

I am retrieving records with an end_date column value that falls between the current date and the date of the last collection. One of the columns is a unique identifier, ProjectID, which will be stored in MySQL2

ISSUE:
I need to verify that no project records retrieved from MySQL1 are duplicates of those already inserted into MySQL2 from a previous collection (this case could occur in a few scenarios, for example, a user changes the end date column for a project). Once I have a SELECT result from MySQL1, say:

Code:
project_id | project_name | end_date -------------------------------------- 10 | Some Project | 11/01/2006 11 | Other Project | 11/05/2006

how do I check these project_ids against those already in MySQL2:

Code:
project_id | project_name | end_date -------------------------------------- 8 | My Project | 10/20/2006 11 | Other Project | 10/15/2006

If a project_id is a duplicate but has a different end_date, I want to keep the most recent.

If a project_id is a duplicate and the rest of the record is identical, I want to ignore the new record.

Thanks for the help!
 
 

Recent GIDBlogA Week in Kuwait by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Archiving and Retrieving data using java with mysql bryan523 Java Forum 2 04-Jun-2006 20:06
[Include] Doubly-linked List dsmith C Programming Language 6 14-Apr-2006 13:12
Strange C++ code memory leakage problem gaoanyu C++ Forum 7 04-Nov-2005 08:09
[CONTEST?]Data Structure Test dsmith C Programming Language 2 06-Jun-2004 15:13

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:09.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.