Bastien Koert napsal(a):
2009/6/3 Martin Zvarík :
"SELECT * FROM xxx WHERE primary_id=123 LIMIT 1"
Is it useless (LIMIT 1) ?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
It doesn't do anything...you are already returning just
2009/6/3 Martin Zvarík :
> "SELECT * FROM xxx WHERE primary_id=123 LIMIT 1"
>
> Is it useless (LIMIT 1) ?
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
It doesn't do anything...you are already returning just the one row
since th
2009/6/3 Martin Zvarík :
> "SELECT * FROM xxx WHERE primary_id=123 LIMIT 1"
>
> Is it useless (LIMIT 1) ?
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Bastien
Cat, the other other white meat
--
PHP Database Mailing List
"SELECT * FROM xxx WHERE primary_id=123 LIMIT 1"
Is it useless (LIMIT 1) ?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Bob Lockie wrote:
If I select rows with a limit clause I need to know if there are more
rows than the limit.
Either do a SELECT COUNT(*) prior to your LIMIT query to see how many
total rows there are, or use SQL_CALC_FOUND_ROWS and FOUND_ROWS() (more
info here: http://dev.mysql.com/doc/mysql/en/
If I select rows with a limit clause I need to know if there are more
rows than the limit.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
it works for me. What do your data and table structures look like?
-Original Message-
From: Fredrik Wahlberg [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 4:55 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql LIMIT and ORDER BY problem
I have a strange problem with LIMIT
I have a strange problem with LIMIT. When I use it like "SELECT * FROM table
LIMIT 0, 10" it works fine. When I add a sort and write the query like
"SELECT * FROM table ORDER BY col ASC LIMIT 0, 10" I get no results.
What am I missing?
/Fredrik
--
PHP Database Mailing List (http://www.php.ne