I have a problem with doing some table updates to mysql.
Here is the scenario:
- User logs in
- php updates the database with log in time, ip, etc.
- User goes to a item selection screen.
This works fine under a user account I have been using to test the system. When I try to add a new account, and that user tries to log in, the system never updates the user table with the login information.
The strange part of this is when I echo the query back to the screen, there is nothing wrong with the query. In fact, if I open a mysql client session and send the update statement straight back to the server, it updates that user account just fine.
Another strange thing is that I use some encryption in this process to protect user information, particularly the username in this case. I have seen an issue like this in the past, and when I changed around the encryption, my primary test account started working. I thought I had this problem solved then.
Also, if I hard code the username into the passing variable, it updates the database with success.
As you can see, this is a bizarre problem. When I pass a string to my login function that has been encrypted at one time, does not work. When I pass a fresh string to the function it works just fine. When I print out both strings they are the same. So, what gives here.
Anybody have any ideas as to why php, mysql or whatever is causing this?
Thanks in advance.
Note: 12:41 PM
I did do a strlen on both strings, and it appears there is white space being added to string that does not echo, but would explain why the query would not work.
I guess my question now turns to, how do I get rid of this white space put there by decryption?
Thanks