I have two MYSQL tables, which I have put into the same format - same
field names, etc.

The update file contains 'new' and 'updated' information, the other is
the master.

I can't get my head around the problem of updating and inserting, other
than
while (next update record)
 - if record ID found, update it
 - otherwise add it.
endwhile

Is there some way of doing it in a more "SQL-like" fashion?  I have it
in the back of my mind that, if I could get my head around the logic of
it, there should be one command UPDATE ALL RECORDS WHICH ARE ALREADY IN
THE MASTER FILE and another INSERT ALL RECORDS WHICH ARE NOT IN THE
MASTER FILE.

Complications are that some records in the master table are marked 'do
not update', and a lastupdated field should be set to today only if a
change is made (i.e, the update and master are identical)

Further complications are the live data is MySQL < V5, but the office
machine is V5.

Any suggestions welcome.

-- 
Pete Clark




The php_mysql group is dedicated to learn more about the PHP/MySQL web database 
possibilities through group learning.  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php_mysql/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to