472,960 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,960 software developers and data experts.

FOUND_ROWS() in Multiple Users Environmnent


Suppose many users will issue SELECT statement to the server, e.g.
1. UserA issued a SELECT statement
2. UserA issued FOUND_ROWS() and get the correct result

The above is okay, but problems might occur when there is more than one

1. UserA issued a SELECT statement
2. UserB issued another SELECT statement
3. UserA issued FOUND_ROWS() and will get the wrong result??

how to handle this?

Mar 14 '06 #1
1 1808
<ho******@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
1. UserA issued a SELECT statement
2. UserB issued another SELECT statement
3. UserA issued FOUND_ROWS() and will get the wrong result??

how to handle this?

FOUND_ROWS() is supposed to be similar to LAST_INSERT_ID(), in that it gives
the correct answer in the context of a given connection, even if other
statements are being executed on different connections.

Try this experiment: open two command windows, and run the mysql shell in
each window. Execute a query in shell A that returns N rows. Then execute
a query in shell B that returns some different number of rows. Then go back
to shell A and execute "SELECT FOUND_ROWS();". It should return the value N
of the previous query you executed in that shell, even though another query
has been executed in the meantime in shell B.

Note that executing "SELECT FOUND_ROWS();" again always returns the answer
1, because that's how many rows were returned by "SELECT FOUND_ROWS();".

Bill K.
Mar 14 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: John Smith | last post by:
I have a user assigned multiple roles and a role can be inherited from multiple parents (see below). How do I answer such questions as "How many roles does the user belongs to?" I answered the...
by: rhamlin | last post by:
I'm fairly new to creating complex sql statements and need a little help. In plain english I want to do this: Select menu rows where the row's userGroupIDs equal the user's userGroupIDs. ...
by: mary | last post by:
I am developing an Access db which will be used by multiple users. My questions are: Does MS Access have problems with multiple users accessing the db at once? If yes, what is your solution...
by: mark | last post by:
I have an asp.net ecommerce web application on a remote web server. I'm using an Access database on the back end. I've notice a few strange things. When I mimic an multiple user environment by...
by: tshad | last post by:
Can I set up multiple pages in the same Location tag? I thought I saw somewhere that I could. I tried the following, but it doesn't work. ***************************************************...
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
by: Gleep | last post by:
I've searched google intensely on this topic and it seems noone really knows how to approch this. The goal I don't want clients to give out their usernames and passwords to friends, since the site...
by: andrea azzini | last post by:
hi to all I use this query SELECT SQL_CALC_FOUND_ROWS * FROM prods LIMIT 100,10; I'd like to know how many rows this query returns without limit, but using this select FOUND_ROWS(); the...
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if my question needs to be here or in coldfusion. If i have my question is in the wrong section i am sorry in advance an will move it to the correct section. ...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.