View Full Version : real headscratcher on table access

08-13-2011, 09:27 PM
I got up this morning thinking i would get some work done lol

I noticed one of my inputs on my site had stopped working correctly, so i looked into it. Everything seemed to be ok. But the record in the db was not being accessed. No value no matter what.

since then i have replaced the entire process from over at another site that works. i could not access the record in the db, it kept telling me that no record exists. for over 4 hours i tried every select statment every mysql statment known to man to access that record and nothing, zippo. I was going nuts i tried everything. Even empty and readded the record and still nothing from the select.

Then just now i thought well maybe somehow the table is currupt. so i deleted the table and put it back and whalla! It looks exactly the same in settings and values as the old one but this one works.

My question is, is it possible that a table could be currupted and not toss an error, i would think you were get some kind of error if there was anything wrong with it.

Have you ever had this happen to you and any way to prevent it?

Old Pedant
08-13-2011, 10:30 PM
Have I ever had a DB and/or table get corrupted? You bet.

Have I had exactly the symptoms you described? No. But I've had other weird symptoms.

So... You don't say what kind of table this was (MyISAM or INNODB or ??). I've had good luck repairing MyISAM tables, not so good with INNODB (with exceptions both ways).

08-13-2011, 11:36 PM
sorry about that it is an MyISAM table, i also forgot to mention there was only one row in there. So its not like it had a bunch of data.

Just id - name - number of days - number of members.

its a coupon table.

with it having only one coupon in there it was easy to clear and just reload, and i did that numberious times to no avail. I even made some new records thru the software and they inserted just fine and updated just fine. but i never could pull a record with select at all. really wierd, i even hard coded the select to remove the variable so that i could test the select.

$query = "SELECT * FROM coupons WHERE id = '1';

and nothing.

but when i replaced the table everything worked fine and i never changed my select so nothing wrong with that.

I compared the two side by side field wise and all the same.

Really strange. And what i thought about doing was taking the old table and exporting it and then doing a compare with winmerge to see any differences but im not sure if that would just be fishing down an empty hole or not.