Hello,

I'm having a problem with my MySQL InnoDB table, only one of five. Every now and then a row or two will go missing completely with no trace of it being there in the first place. I have a website which takes HTTP requests from my desktop side client app and if their HWID isn't in the database, it adds it. The app connects every 1-5 minutes and works flawlessy (if I delete their row while it's running, it re-adds it. If I delete the row, then run the app, it re-adds it again).

But for some reason, once the row goes missing by itself, it won't re-add until it decides it wants to (seems to be random times). I've looked around online and can only find information on things such as missing rows once tables have been converted from MyISAM to InnoDB - my tables were created as InnoDB tables.

Any advice?
Thanks.

To be clear, are you saying that the database removes the rows? that is, no calling code is responsible? And if the database has removed a row, your app won't add it again like its supposed too?
How are you determing that a row has disappeared?

The behavior doesn't seem to be from the database table itself but could be a hidden bug in your application. It is not easy to catch this kind of bug unless you are lucky enough to create the exact condition. I would rather look through your code than to assume from the situation...

To be clear, are you saying that the database removes the rows? that is, no calling code is responsible? And if the database has removed a row, your app won't add it again like its supposed too?
How are you determing that a row has disappeared?

I'm not sure what's responsible but it seems to be that once the row has disappeared, it adds back at random times - my application will connect multiple times but only add back randomly.

The difficulty with this is that the above paragraph makes it look highly likely that my application sending the data is responsible. But, it works flawlessly with everyone, up until a row seems to disappear out of thin air.

The behavior doesn't seem to be from the database table itself but could be a hidden bug in your application. It is not easy to catch this kind of bug unless you are lucky enough to create the exact condition. I would rather look through your code than to assume from the situation...

What sort of code should I be looking at? I don't think it's my application because all that does is send data to php files which then handle the mysqli part. The thing is, is that is only does it for some people and not others - it doesn't do it for me so it's super difficult to debug (as you've mentioned about the exact conditions).

Is the PHP code being used by anything else? If yes, then you could check whether it is your code (possibly) by seeing if the error occurs when another app uses the PHP library. Is that possible?
Otherwise, is it always the same people that get the error? And some never get it? Any information you can get will help you track down the cause.
Lastly, is adding logging code around the inserting/updating code feasible? If you could start logging the events you might locate the problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.