Annoying Poll

Where we keep all the boring tidbits about the PHPDN site, the news, and what not.

Moderator: General Moderators

Most annoying type/bug/error in PHP.

Missing ;
22
15%
if ( $supersecretpw = $test_password )
17
12%
((())())(()))(())((())
16
11%
}...hrm, now which one does this go to?
25
17%
Headers already sent, damnit!
36
25%
Notice: Undefined variable...grrr
7
5%
Function does not exist...*boom!*
5
3%
Internal Server Error 500...Noooooo!!!!
7
5%
.asp/.cfm/.jsp/.pl
0
No votes
Cannot access phpdn database. Database is unreachable...
10
7%
 
Total votes: 145

jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Annoying Poll

Post by jason »

Well, you can probably guess I am doing some coding, and I am getting hit with a lot of annoying typo's. So I was curious, what is your most hated typo?

What about your worst bug ever? Or stupidest moment? We've all had them, that moment where you suddenly realized the very easy fix after having spent many hours (or days) trying to find the problem.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

The good old use of the assignment operator instead of the comparison operator is a killer :)

Mark
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

I hate that "cannot assign value to scalar-variable" - I knew the solution, I fixed it repeatedly, but I forgot how to do it. And I will keep forgetting it every time I've fixed it.

Image
Image
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Re: Annoying Poll

Post by malcolmboston »

jason wrote:Or stupidest moment?
The day i came onto devnetwork asking for why my insert script was'nt working it was something like

Code: Select all

$query = "INSERT INTO blah whatever";
$affected_rows = mysql_affected_rows($result);
affected rows was telling me it had inserted it had me stumped for hours, bech then told me i had'nt actually queried tha database, absolute proof, you should'nt spend 16+ hours solid coding.
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Re: Annoying Poll

Post by jason »

malcolmboston wrote:you should'nt spend 16+ hours solid coding.
No?

Damn!
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

heh, my stupidest error was in SQL query:

Code: Select all

update sometable inner join someothertable set sometable.value1='something', someothertable.value2=999999 where sometable.id=$something
It was supposed to be:

Code: Select all

update sometable inner join someothertable   

ON sometable.somefield1=someothertable.somefield2

set sometable.value1='something', someothertable.value2=999999 where sometable.id=$something
It has updated entire someothertable (about 1.5M records...) instead of just 1. Thank God it was on development db server.....
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Heh, the first time I used SQL I got my results back (after the n-th error) , was proud like Uncle George and then needed to sort them.
So I started writing a bubble-sort in PHP... and after about one hour thought: "Wait! These mySQL-people must have something similar..."

One of those days when you look into the mirror and think: "That guy there, yeah, you who's looking at me: you're stupid. S T U P I D!" :lol:
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

This isn't really a bug just fatigue. Occasionally I will make a change to code move the file to the server, test it, change the code again because it didn't work, move it to the server, test it..... And so on until I realize I was moving the wrong file to the server.
jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

hawleyjr: And then you realize you have been overwriting the live server's copy, not the development...and that you don't have a backup...
mexiconsin
Forum Newbie
Posts: 1
Joined: Thu May 20, 2004 9:40 am
Location: Royal Oak, Michigan

clobbered file

Post by mexiconsin »

jason wrote:hawleyjr: And then you realize you have been overwriting the live server's copy, not the development...and that you don't have a backup...
I work on three computers at home with Windoze/Samba networking and spent a whole day tweaking a database. I work from multiple monitors and never remember which box has the actual file. After several hours of myriad tweaks, I decided to "back up" my master copy and copied the file in the wrong direction.

You cannot recover a network-clobbered file! Fortunately, there is a happy ending. After two hours of panic, I finally found my file in a different directory. Since then, I've reorganized my directory structure and think long and hard before transferring files in Network Neighborhood.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

sounds like a good opportunity for source control, there mexiconsin
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

And so on until I realize I was moving the wrong file to the server.
Or this one always cracks me up when I do it.

After repeated uploads and tests WS_FTP times out and disconnects. No, I don't fail to notice that and reconnect. I reconnect and fail to upload the modified file! Then I can't figure out why my change didn't work. Seems I somehow think that merely reconnecting is all I need to do!
:oops:
spectre013
Forum Newbie
Posts: 5
Joined: Wed Jul 09, 2003 9:09 am
Location: Colorado, USA

Post by spectre013 »

My dumbest (biggest) is along the same lines as "Weirdan" I didn't ad the where clause to a sql update and updated about 15,000 obituaries with the same information.

THanks god for backups.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

:lol:
Unconditional UPDATE rocks!
:lol:
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

The worst are the ones which spit out a line number far removed from the source of the problem.

Or declaring a class twice, similarly.
Post Reply