PHP/MYSQL - update table (not update record, but add new...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bhonan
Forum Newbie
Posts: 14
Joined: Sat Feb 02, 2008 12:55 pm

PHP/MYSQL - update table (not update record, but add new...

Post by bhonan »

Having trouble searching for a way to update a mysql table. There are over 1000 records and each day some are added and some are deleted on another server. All I received is an updated CSV daily. I can delete all the records and add in all new ones, but that seems unnecessary... where can I find some info on how to update a table?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: PHP/MYSQL - update table (not update record, but add new...

Post by Christopher »

It is probably fastest and easiest to delete all rows and then import everything. DELETE and TRUNCATE are very fast, and LOAD DATA INFILE is likewise fast. Otherwise you will be doing a lot of work and it will probably be slower.
(#10850)
Post Reply