There is a query
UPDATE users SET hash =: hash, num_try_incorrect_pass = 0
WHERE email =: email; SELECT * FROM users WHERE email =: email
First perform UPDATE
Next SELECT
How to do this with one request?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How about using
stored procedures?If you are looking for execute both queries from one code-statement you can define them as stored procedure in your database.You can then execute both of these statements though your php code in this manner:
For more info: Getting Started with MySQL Stored Procedures