D'oh!!

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

D'oh!!

Post by s.dot »

Being on PHP DN, I assume we are all PHP programmers or at least a programmer of some nature. Starting out in PHP I had problems like any n00b would.
  • I didn't know $_GET from $_POST from a hole in the ground.
    I'd always separate my arrays ($SQL = "", $QUERY =, $ARRAY =), not wrong, but definately a lot more typing.
    I'd check my page to make sure it went right even after little commands like echo "hi";
But I'm interested in your big screwups :-D .

I'll go first:

My biggest screw up came about a month and a half ago. I wrote a script that would pick out users whos accounts had no pictures, and then delete them and their directory from the server and database. But, something went awry in the script and I deleted EVERY PICTURE on the server. Almost 2 GB of pics! D'oh! Lesson learned: keep backups.

What's your biggest mess up?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

6 years ago, i was the admin of a server, and was kicked off the system when i was installing ipchains and the default deny all rule :P Luckily it was a server of me and some friends, no boss to complain ;))
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I've never had a big screwup... I'm too good :P

Nah but seriously, I can't think of anything right now but I'm sure something will come to me shortly. I certainly havent caused damage using PHP by mkistake (I have however had cockups mistypin a linux command - BIG STYLE).
Deemo
Forum Contributor
Posts: 418
Joined: Sun Jan 18, 2004 11:48 am
Location: Washington DC

Post by Deemo »

i have never really written a program that would cause a computer to blow up, but the worst i ever did was overwriting 200 rows in a database by uploading the old version :(


lots of typing after that happened 8O
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Deemo wrote:i have never really written a program that would cause a computer to blow up, but the worst i ever did was overwriting 200 rows in a database by uploading the old version :(


lots of typing after that happened 8O
I've done that before, but with many years worth of data - luckily I have a cool host that performs backups regularly.
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

My biggest problem is similar to those, mistaken deletes in the DB. Never via PHP alwasy by command-line direction connection to the DB. DELETE FROM foo; instead of DELETE FROM bar;.... Luckily it was on a test server and only took about an hour to reload that data..... Still I've made a habit of turning off auto-commit now and not doing manual db manipulation late at night....
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

That is even more fun with cascading delete/updates ;))


Ah well, these are all good examples why backups are required ;)
Meaby another topic: What is your backup strategy?

incremental bacup daily, full backup weekly?
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

timvw wrote:That is even more fun with cascading delete/updates ;))


Ah well, these are all good examples why backups are required ;)
Meaby another topic: What is your backup strategy?

incremental bacup daily, full backup weekly?
PITR :)
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

I've never had any major howlers with PHP. However a few years back I wrote a little Perl util to go through some 6000+ files grepping out some of the data. Unfortunately, I had piped the data in the wrong direction and ended up with 6000+ empty files.
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

The first major screwup: When I started progging I made a palm handheld version of 'the sims' called 'the bums' I spent a good 6 months on it. Never backed up. Not once. Needless to say, i lost it all. Lesson learned!

Second majour screwup: I used fopen("blah", 'w') instead of fopen("blah", 'r') on my entire reviews folder on http://www.acdrifter.com. Luckily my friend who does the content was online so he was able to upload the reviews in a few seconds. But still, I was quite worried.
User avatar
nielsene
DevNet Resident
Posts: 1834
Joined: Fri Aug 16, 2002 8:57 am
Location: Watertown, MA

Post by nielsene »

Todd_Z wrote:The first major screwup: When I started progging I made a palm handheld version of 'the sims' called 'the bums' I spent a good 6 months on it. Never backed up. Not once. Needless to say, i lost it all. Lesson learned!

Second majour screwup: I used fopen("blah", 'w') instead of fopen("blah", '<span style='color:blue' title='ignorance is bliss'>are</span>') on my entire reviews folder on http://www.acdrifter.com. Luckily my friend who does the content was online so he was able to upload the reviews in a few seconds. But still, I was quite worried.
the aolbonics filter strikes again... Of course, given your avatar, I almost expected to be "arrrrrghh" instead :)
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

My very first week on my current job, I was working on a database. I had to delete an entry so I thought I'd have some fun and re-write it to say "Whoops, I did a bad bad thing".

In hindsight that wasn't too smart because I forgot a little thing called a "where" clause in my query. So, for about 3 hours until we got the backups, every entry in this particular database said "Whoops, I did a bad bad thing".

Fortunately it was summer so people were just light-hearted about it.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

My biggest screw up is the same as pickle's except with a delete, yep 70,000 rows gone because of no where clause, luckily had a backup from the previous day already on the server and all I had to do was open up putty.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

redmonkey wrote:Unfortunately, I had piped the data in the wrong direction and ended up with 6000+ empty files.
Long live "find /path -empty" :)
Post Reply