PHP mistakes you keep making?

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
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

PHP mistakes you keep making?

Post by JAB Creations »

I just blew like an hour trying to find out why JavaScript was returning nine rows instead of ten in my chat room when you first entered. Then I thought hmm, no amount of commenting out is working, maybe check the server? So I looked at the MySQL and sure enough, it was returning ten rows. I looked at the PHP output and saw nine rows. But there was nothing wrong with the file! Then I looked up and saw I had mysql_fetch_assoc set twice for the same query! DOH! :evil:

So what mistakes are other people making? Let us bask in the glory of confusion! :drunk:
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: PHP mistakes you keep making?

Post by josh »

Check out mysql_data_seek(). Id have to say my biggest mistakes are not unit testing enough.
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: PHP mistakes you keep making?

Post by JAB Creations »

Neat, thanks! :)
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Re: PHP mistakes you keep making?

Post by JayBird »

Spending hours trying to figure out why a code change wasn't working on a site, only to realise you have uploaded it to the wrong server
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Re: PHP mistakes you keep making?

Post by Bill H »

Spending hours trying to figure out why a code change wasn't working on a site, only to realise you have uploaded it to the wrong server.
Or not uploaded it at all.
Or re-uploaded the last change you were working on, instead of uploading this one.
Last edited by Bill H on Thu Jan 22, 2009 9:27 am, edited 1 time in total.
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: PHP mistakes you keep making?

Post by Eran »

Start using revision control and automatic hooks ;)
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Re: PHP mistakes you keep making?

Post by Bill H »

Start using revision control and automatic hooks
And miss the fun of trying to figure out why the change was not working on the server?
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: PHP mistakes you keep making?

Post by papa »

JayBird wrote:Spending hours trying to figure out why a code change wasn't working on a site, only to realise you have uploaded it to the wrong server
Haha that's a classic. :)
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: PHP mistakes you keep making?

Post by Eran »

And miss the fun of trying to figure out why the change was not working on the server?
:P
User avatar
kaisellgren
DevNet Resident
Posts: 1675
Joined: Sat Jan 07, 2006 5:52 am
Location: Lahti, Finland.

Re: PHP mistakes you keep making?

Post by kaisellgren »

When I test my script I notice my recent changes do not work, I keep thinking and thinking and debugging the script until I finally realize that all I have to do is to remove cache files x)

Right now that won't ever happen again - I made the caching to not happen when in DEBUG -mode :)
Post Reply