PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm working on a DB which has all the passwords stored as plain text. What I want to do is retrieve all the passwords, convert them to SHA-256 hashes and then store them in a new field in the same table (I'm keeping both sets of passwords in there until I've updated other scripts).
The problem I'm getting is that my UPDATE query is in a while() loop and it only runs once. Rather than spend another hour trying out solutions that don't work, could anyone tell me what I'm doing wrong? I'm aware that running queries inside while() loops is sub-optimal but the script is only being run once.
Thanks for all the other responses as well - I'm sure there's a way to do this much more efficiently. Being lazy, I probably should have checked to see what hashing functions MySQL has access to.
Anyway, that's another mini-crisis done and dusted That brain-dead question was brought to you today by the letters