[PHP-DB] MySQL - LIMIT 1 on primary KEY - makes sense?

2009-06-03 Thread 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

Re: [PHP-DB] MySQL - LIMIT 1 on primary KEY - makes sense?

2009-06-03 Thread Bastien Koert
2009/6/3 Martin Zvarík mzva...@gmail.com: 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

Re: [PHP-DB] MySQL - LIMIT 1 on primary KEY - makes sense?

2009-06-03 Thread Martin Zvarík
Bastien Koert napsal(a): 2009/6/3 Martin Zvarík mzva...@gmail.com: 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

[PHP-DB] mysql limit

2004-06-30 Thread Bob Lockie
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

Re: [PHP-DB] mysql limit

2004-06-30 Thread John W. Holmes
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:

RE: [PHP-DB] mysql LIMIT and ORDER BY problem

2002-02-20 Thread Rick Emery
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

[PHP-DB] mysql LIMIT and ORDER BY problem

2002-02-19 Thread Fredrik Wahlberg
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.net/)