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 8430155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:31:55+00:00 2026-06-10T05:31:55+00:00

Is it ok to use mysql_affected_rows to get the number of rows affected while

  • 0

Is it ok to use mysql_affected_rows to get the number of rows affected while doing an update by a user? What if there are several users updating their passwords and I need to know if each users update was successful or not. So if 3 users did updates simultaneously, mysql_affected_rows might return 2 even if one users update was not successful. Is that how it is? I cannot test with multiple users simultaneously. How safe is this.

  • 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-10T05:31:56+00:00Added an answer on June 10, 2026 at 5:31 am

    It’s safe. It only returns data about the last query in your own connection.

    PHP documentation (thanks to Fluffeh):

    Get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE query associated with link_identifier.

    Since it’s a thin wrapper over MySQL C API, we can also check that:

    my_ulonglong mysql_affected_rows(MYSQL *mysql)

    It’s not explicitly said anywhere as far as I can see, but it does take the connection identifier and it seems that the general pattern is that all the functions return data about the specific connection:

    Using LAST_INSERT_ID() and AUTO_INCREMENT columns simultaneously from multiple clients is perfectly valid. Each client will receive the last inserted ID for the last statement that client executed.

    Anyways, it would be pretty unusable if you could not be sure whether the result you obtained is yours or not.

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

Sidebar

Related Questions

I have a problem with mysql_affected_rows() function in PHP. I use MySQL update, in
When I use mysql_affected_rows($result); ...in php then I get below warning how to remove
Is there any possibility to use an after update trigger only in the case
How do I know how many rows were affected by an update query? mysql>
What is the SQL statement for retrieving the number of affected rows of the
We use MYSQL InnoDB engine for insert and update operations, in order to improve
I want to use MySQL to collect the sum of the rows that are
I'm trying to get my MVC3 application to use MySql database instead of Sql
I use the following query, to delete the rows from two tables delete itc,
I call a procedure, it runs, and the console says 0 rows affected. Is

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.