Page 1 of 1

LESSON LEARNED! Ouch! :(

Posted: Thu Aug 15, 2002 3:06 pm
by JPlush76
ok so I'm writing a program for people to be able to update their pictures on their profiles...

well like a dumbass instead of taking some time to back up the table or make a test DB I just said, eh this is quick I'll use the live system

well here was my query statement:

Code: Select all

update user set user_image = '$filen'

instead of:

Code: Select all

update user set user_image = '$filen' where user_id = $userid
OH LORDY, it just updated all my records with the same damn file

luckily is under 100 records, but now I have to redo them all manually, I think I've learned my lesson on paying attention :)

Posted: Thu Aug 15, 2002 3:41 pm
by Johnm
Don't you backup your database? If not, I highly recommend that you consider it.
It has saved my ass a time or twenty.

Direwolf

Posted: Thu Aug 15, 2002 3:52 pm
by jason
The power of the CronJob. Have cron back it up for your. =)

Posted: Thu Aug 15, 2002 4:00 pm
by Johnm
Cron good!

Direwolf

Posted: Thu Aug 15, 2002 4:07 pm
by hob_goblin
my host makes gzips daily for me, and i can download the day's backup of all the mysql db's and the file system whenever i want :)

Posted: Thu Aug 15, 2002 4:13 pm
by JPlush76
I'm sure my host does backups too but it was only one field in the DB if it was the whole table I probably would have called them.

I usuall back up everything too

<-- runs and cries