Weirdest Primary key issue

Hello all,

I have been having the strangest issue with a login system. Its a login system with users, each having a user id. Everything works fine, but ONLY for certain Primary key “ID”'s.

Example:
#1 John
#2 Sam
#3 Mike

John and Mike can pull up their info on login. Sam cant. If I delete Sam and edit Dave as #2, Dave doesnt work. If I delete Mike and edit Dave to #3, Dave starts working. Then move back to #2, stops working. So its not specific to user or users data, its specific to ID. Only #1, #3, #5, #8, #10, #11 work. All others fail.

I have no code that excludes ID’s in any way shape or form. I would include code but there is too much and there is nothing in it to explain this issue. It defies logic really.

One thing to note, the ID’s that DO work were all INSERTED in mysql two months ago. So ultimately the issue is that only fields with IDs that were created two months ago work. New ID’s dont work. New entries changed to an old ID, it starts working. Change them back to a new ID, stopped working.

I am boggled and anyone with a hint on why this could happen would be great. Ive been using mysql for years so I dont think its a noob issue. Any help would be amazing!

You have applied a lot of good troubleshooting effort on this problem.
If it is an auto-generated field (and the primary index) I think it is a bad idea to be manipulating the ID field in your MySQL database.

This is based on my personal experience only.
I do not have as much database experience as many others here and hope they will chime in.

Make sure there isn’t some kind of lock on those records.

I figured it out! Haha stupid me, I have a function that pulls from the users folder for personal files and at some point it stopped working. Basically only folders 1,3,5,8,10,11 existed therefore my php would break upon not finding the users folder (if the ID wasnt one of the above). Fixed the function that creates them a folder and it fixed the problem. Thanks for everyones help.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.