Jump to content

What causes random errors in a data pull from a database using PHP/MySQL?


blurredvision

Recommended Posts

Since the project I'm working on is too big to post here, I'm just wanting to get an idea of what can cause this, since I'm stumped.  Basically, I have one piece of code about 150 lines long that handles pulling a series of stats from two different tables (one are home team stats, the other away team stats) of a MySQL database.  I created it and tested it, and everything looked like it work beautifully.

 

However, I started to notice that out of the 70 or 80 games I had entered so far, there are 5-10 instances where the pass attempts value is just duplicating what the pass completions shows.  With 90% of the games, the pass completions and attempts show correctly, but with the other 10%, the pass attempts are the same as the pass completions.  So I thought it was just an error on my entry, but after checking the games I've noticed this on, the database shows the correct values.  The database values are correct, the code is correct, 90% of the time it's working fine.  It's just these few games that show incorrectly, and it's only the home team.

 

Can anyone give me any clue as to why this happening if everything is correct on my end?  I've spotted this problem on two different computers, and I've also used different browsers, so I'm pretty sure the problem is with the database and not any kind of caching or something like that.  There are only 5 tables, all MyISAM.

 

Thanks for any insight on what to read up on or what to look for.

Link to comment
Share on other sites

I doubt it's more than an error in your code

 

Well, the reason I don't think it is is because everything uses the same code and the same loop.  Why would it return the value correctly 90% of the time, but return it incorrectly 10% of the time, when I visually verify that the value is correct in the database?  This just baffles me.  I'll take another look at it and do your suggestion, we'll see what happens.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.