So what mistakes are other people making? Let us bask in the glory of confusion!
PHP mistakes you keep making?
Moderator: General Moderators
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
PHP mistakes you keep making?
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! 
So what mistakes are other people making? Let us bask in the glory of confusion!
So what mistakes are other people making? Let us bask in the glory of confusion!
Re: PHP mistakes you keep making?
Check out mysql_data_seek(). Id have to say my biggest mistakes are not unit testing enough.
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: PHP mistakes you keep making?
Neat, thanks! 
Re: PHP mistakes you keep making?
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
- 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?
Or not uploaded it at all.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 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.
Re: PHP mistakes you keep making?
Start using revision control and automatic hooks 
- 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?
And miss the fun of trying to figure out why the change was not working on the server?Start using revision control and automatic hooks
Re: PHP mistakes you keep making?
Haha that's a classic.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
Re: PHP mistakes you keep making?
And miss the fun of trying to figure out why the change was not working on the server?
- kaisellgren
- DevNet Resident
- Posts: 1675
- Joined: Sat Jan 07, 2006 5:52 am
- Location: Lahti, Finland.
Re: PHP mistakes you keep making?
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
Right now that won't ever happen again - I made the caching to not happen when in DEBUG -mode