LESSON LEARNED! Ouch! :(

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

LESSON LEARNED! Ouch! :(

Post 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 :)
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post 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
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

The power of the CronJob. Have cron back it up for your. =)
User avatar
Johnm
Forum Contributor
Posts: 344
Joined: Mon May 13, 2002 12:05 pm
Location: Michigan, USA
Contact:

Post by Johnm »

Cron good!

Direwolf
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post 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 :)
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post 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
Post Reply