Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8896315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:00:42+00:00 2026-06-15T00:00:42+00:00

There is a query UPDATE users SET hash =: hash, num_try_incorrect_pass = 0 WHERE

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:00:44+00:00Added an answer on June 15, 2026 at 12:00 am

    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.

    DELIMITER //
    CREATE PROCEDURE ExecuteQueries(IN pEmail VARCHAR(50),
                        IN pHash VARCHAR(60))
      BEGIN
        UPDATE users SET hash=pHash, num_try_incorrect_pass = 0 WHERE email = pEmail;
        SELECT * FROM users WHERE email = pEmail;
      END //
    DELIMITER ;
    

    You can then execute both of these statements though your php code in this manner:

    $stmt = $dbh->prepare("CALL ExecuteQueries($sEmail,$sHash)");
    

    For more info: Getting Started with MySQL Stored Procedures

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with ~800k rows. I ran an update users set hash
This one has me rather confused. I've written a query which runs fine from
$sql=update users_contain set wood_max = (Select building_production from building_level where merge_id=$subPrimaryKey and empire_id=$user_empireID) ,
I have this: if(isset($_POST[Submit])) { $updatequery = @mysql_query(UPDATE users SET FirstName='.$_POST['firstname'].', LastName='.$_POST['lastname'].', Address='.$_POST['address'].', City='.$_POST['city'].',
I have a query that updates one record, and only one record. Is there
I am building a rails3 web app. Is there a query like this in
There are two types of query parameters binding in the Hibernate Query. One is
i would like to generate strict alphanumeric character logins from users' first and lastname.
mysql_query(update users set balance=balance+'$pwbalance'-'$totalprice' where memberid='$memberid' and (balance+'$pwbalance'-'$totalprice')>=0)or die(mysql_error()); $count=mysql_affected_rows(); When I echo $pwbalance,
I want to update a table: $result=mysql_query(select balance from tablename where userid='$userid)or die(mysql_error()); $row=mysql_fetch_assoc($result);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.