Click to See Complete Forum and Search --> : And the Mong Of The Month award goes to..


onion2k
03-09-2005, 06:14 AM
Me.

A clients website had been working for the last 18 months. No problems, no code changes, a few software upgrades but nothing big, and nothing that broke the site. Until today. When it stopped working..

Nightmare. What on earth could have gone wrong? The data in the database looks fine. The code hasn't been altered. The log files don't show any hacking attempts. What the hell?

Eventually I do a SQL dump of the database to run it locally. Lo and behold what do I see? Lots of '\r's in the data! Where did they come from? Wherever.. it meant my code that compared a string (part of a postcode) with the text in the database was never going to return true.

Moral of the story: trim() things going into the database if you're to compare them with user input later.

Must have written the original code on a Monday.

RossC0
03-09-2005, 08:37 AM
lol!

'It was working yesterday fine,
I haven't done any changes...'

Panic, Pull hair out and curse loudly...

Loop until solution found! :D

bubblenut
03-09-2005, 08:50 AM
hehe ;)

Not bad but you've got some serious competition in this thread (http://www.phpbuilder.com/board/showthread.php?s=&threadid=10226877&perpage=40&pagenumber=1)

Shrike
03-10-2005, 09:36 AM
Yesterday. I ran a perl script to update some static HTML pages. Then realised that the regexp hadn't quite worked so spent 45 mins doing some little corrections. So that was a bit of a drag, but not too bad.

So check the files. Everything is ok. Right lets go back to the terminal and do an upload. Hey isn't it a neat feature that the up arrow repeats the last command - not when you accidentally re-run the perl script and overwrite your work :glare:

Bunkermaster
03-10-2005, 10:02 AM
hahahh classic.

Good panic moment when your code stops working for some unknown reason. Always educational