Jump to content

[SOLVED] The Magic Disappearing Data!


defeated

Recommended Posts

I have an odd problem happening with one of my mysql tables.

 

Every now and again a line of data becomes blank with the exception of the id (auto inc).  This is awkward because it is a list of users.

It would seem that it is always the last user that gets deleted.

 

Deleted is the wrong word to use because the row is not deleted... just stripped of all it's data.  The row remains. (oh, and so does the encrypted password in that row and two other fields).

 

My question is what sort of query would do this?  I am assuming it is not some flaw with mysql the weaker link between mysql and my coding being myself.

 

I can't think of any code on the site that runs a query capable of making these changes.

 

I can't reproduce it at will either.  It just "happens" every now and again. So it's not something running in a regular cron job.

 

I know it's hard to give an answer without the code.... but there is a LOT of code on the site and I don't know which bit is relevant yet. I'm just looking for suggestions of what potential causes of the problem may be.

 

Cheers.

Link to comment
Share on other sites

It is likely to be an MySQL query line that begins...

 

UPDATE table_name

 

I'd recommend searching for lines of code that have that text in them. You then need to see if it can be called accidently passing no data in to it.

Link to comment
Share on other sites

Cheers cags.  That makes sense... not awake this morning!  I just wish I'd noticed this early on, rather than after I'd written thousands of lines of code on lots of pages that interact with that table.

 

I'll mark it as solved for now, because logically that's all it could be.

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.