Updating mysql database with php
If I encounter any other issue, I will let you guys know but for now, the update query is working. I was really trying to get the OP to give a bit more information rather than just saying "doesn't work".
I figured the try-catch around the query might have given an error, is that not the case?
The moment that query runs, there’s no way to get back whatever row it was that you deleted.
Test all delete queries with a , which we’ll get to in a moment. You’ll get something looking like this: Suppose Johnson from accounting wants to modify his password- he left it on a sticky-note under his keyboard and now everyone can access our Super Secret database.
We do this through the use of a only the passwords that match that particular username, and then we use the same function as we did in the Change User page to retrieve the password and match it against the password entered.
You’ll get something that looks like this: The alert reader might notice that we used a command could be used to authenticate in other places as well- namely, as a login system.
If an update on a row would result in a violation of a primary key or unique index, the update on that row is not performed.
This may seem difficult to grasp, but it will become clearer as we move into practical usage in PHP.You’re not going to need to know the inner workings and nuts and bolts of My SQL for this tutorial, but there are a few things you should know about what we’ve just done.The function here, however, may need some explanation: we’ve created a table and populated it with three columns: username, password, and email.The only challenge I'm having with the code below is that the update query doesn't work. Does it throw an error, in which case what's the error message?I want the generated key stored in the database against the selected email address so that the stored key and the one sent via email to the user who forgot his password can be compared and if they are the same, he can be presented with password update form. If you type the query in with good values from phpmyadmin (or whatever you use) does the query work there? If you follow the code through with echo() debugging statements, does that not help show where things go wrong?