Previous Thread
Next Thread
Print Thread
Rate Thread
Updating a table without emptying it first #285452
05/30/2005 3:44 PM
05/30/2005 3:44 PM
Joined: May 2005
Posts: 4
Musicarl Offline OP
Lurker
Musicarl  Offline OP
Lurker
Joined: May 2005
Posts: 4
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.

Sponsored Links
Re: Updating a table without emptying it first [Re: bigjoeyc] #285453
05/30/2005 4:08 PM
05/30/2005 4:08 PM
Joined: May 2001
Posts: 550
Austria
Anno Offline
Code Monkey
Anno  Offline
Code Monkey
Joined: May 2001
Posts: 550
Austria
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"

Re: Updating a table without emptying it first [Re: domain123] #285454
05/31/2005 5:17 PM
05/31/2005 5:17 PM
Joined: May 2005
Posts: 4
Musicarl Offline OP
Lurker
Musicarl  Offline OP
Lurker
Joined: May 2005
Posts: 4
That little checkbox allowing me to overwrite the data did the trick. Thanks for your help.


Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with, and recommend, the following Web Hosts:
· Stable Host
· Blue Host
· Interserver.net
Visit us on Facebook
Member Spotlight
Nettomo
Nettomo
Germany, Bremen
Posts: 417
Joined: November 2001
Show All Member Profiles 
Forum Statistics
Forums64
Topics37,483
Posts293,589
Members13,810
Most Online1,498
Mar 17th, 2017
Top Posters(All Time)
AllenAyres 21,084
JoshPet 10,370
LK 7,395
Lord Dexter 6,709
Gizmo 5,781
Greg Hard 4,625
Top Posters(30 Days)
isaac 16
driv 13
Gizmo 5
Today's Statistics
Currently Online 954
Topics Created 0
Posts Made 0
Users Online 2
Birthdays 24
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2019 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.2
(Snapshot build 20190323.dev)
PHP: 5.4.45 Page Time: 0.030s Queries: 15 (0.011s) Memory: 3.1950 MB (Peak: 3.4271 MB) Data Comp: Zlib Server Time: 2019-03-25 09:33:28 UTC