UBB.Dev
Posted By: Musicarl Updating a table without emptying it first - 05/30/2005 10:44 PM
We have a table that gets a lot of activity and has about 4,500 records. I update it by using PhpMyAdmin to empty the table and then replace it with a textfile. A few days ago, as soon as I emptied the table the server went as screwy as I've ever seen it. We would reboot, and it would still go crazy - not returning queries, not accepting passwords, etc. After 2 days, we were able to load the textfile and the server has been fine since.

Our tech people think the table was receiving queries and since there was nothing in it, some nasty loop situation occurred.

Is there a way to update a table with entirely new data without dropping it first? Any suggestion on how to solve this problem are appreciated.
Posted By: Anno Re: Updating a table without emptying it first - 05/30/2005 11:08 PM
Did you drop it or only delete the content?

To delete the table content: DELETE FROM "tablename"

Then insert whatever you wish to insert.

To insert data into a table that already contains potentially the same data:

REPLACE INTO "tablename"
Posted By: Musicarl Re: Updating a table without emptying it first - 06/01/2005 12:17 AM
That little checkbox allowing me to overwrite the data did the trick. Thanks for your help.
© UBB.Developers