defeated Posted November 13, 2009 Share Posted November 13, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/181368-solved-the-magic-disappearing-data/ Share on other sites More sharing options...
cags Posted November 13, 2009 Share Posted November 13, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/181368-solved-the-magic-disappearing-data/#findComment-956750 Share on other sites More sharing options...
defeated Posted November 13, 2009 Author Share Posted November 13, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/181368-solved-the-magic-disappearing-data/#findComment-956756 Share on other sites More sharing options...
cags Posted November 13, 2009 Share Posted November 13, 2009 If it is blanking all values then obviously it can only be a MySQL query that SETS all fields. That should also help to narrow it down. Good luck Quote Link to comment https://forums.phpfreaks.com/topic/181368-solved-the-magic-disappearing-data/#findComment-956757 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.