--- In php-list@yahoogroups.com, <[EMAIL PROTECTED]> wrote:
>
> Hi all,
> 
> I have a quick question.
> 
> If I am getting a small range of results using the mysql LIMIT
function then how can I tell how many results there would have been 
> if I didn't use LIMIT with the same query?
> 
> Thanks.
>

---

The only way I'm aware of is to do the SELECT statement twice - once
with the full amount, and once with the limited amount. Something like
this:

// To get total amount
$query = "SELECT * FROM users";
$result = @mysql_query($query);
$num = mysql_num_rows($result);

//To get limited amount
$query = "SELECT * FROM users LIMIT 20";
$result = @mysql_query($query);

Reply via email to