If the table has a unique key then add the REPLACE keyword. This will update the columns with new values if the key already exists and add the row if it doesnt.
--Mark Michael Kaiser wrote: > Using the following inserts data from a text file into a particular MySQL > table: > > LOAD DATA LOCAL INFILE "file.txt" INTO TABLE whatever; > > Is there any way to do this, but instead of inserting, it's updating? > > Michael Kaiser > LivingLegend.net > [EMAIL PROTECTED] > > "Many folk like to know beforehand what is to be set on the table; > but those who have laboured to prepare the feast like to keep their secrets; > for wonder makes the words of praise louder." > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php