I need to update a user's password from PHP, this is accomplished through an ALTER USER statement. I can't use prepared statements, because they do not support DDL commands. The username field can be easily sanitized my making sure it matches an Alphanumeric regex, but I can't figure out a safe way to sanitize the password.
How should I do this?
I'm aware the situation isn't ideal, but I do not call the shots here. I'm just trying to keep it as secure as I can.
EDIT: Here's an example of what I'm trying to run
ALTER USER myusername IDENTIFIED BY mynewpassword1
This runs in SQL Developer successfully, and I could make it work through concatenation, but I'm hoping to avoid that.