Hello everyone! Is there a way to update records in a database from a text file? Let's say I have an inventory database and I get most current inventory in a TXT file every day. I automatically drop all the records in DB and import the whole new thing from the text file. It works fine for me right now, but in order to monitor changes I would like to be able to update only changed records in the database, delete those that are gone and insert the new ones - this way by adding additional tracking fields I can monitor changes in the inventory. So, how do I update my database in that way from the TXT file I've got? Any hints or where to look would be nice. Thanks!
Try looking at the fopen and feof functions in the PHP reference. There's some stuff in there about opening CSV files and such like. I do something similar to this using CSV files on a user database here at work.
Thanks for the fast reply guys! ON DUPLICATE KEY UPDATE sounds interesting. Not sure if it will work if I have more fields in the database then in the text file - I need to look more deeply into it. Thanks for your help !