Re: MySQL Query and Fetch
| From: | David Robley | Date: | Mon, 04 Sep 2000 02:50:01 +0000 |
| Subject: | Re: MySQL Query and Fetch | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15039@lists.php.net to get a copy of this message | ||
On 3 Sep, Kent Wang wrote:
> When I request a query that returns multiple rows, are the rows dynamically
> sent only when I use fetch? In other words, will the MySQL server hold onto
> the extra rows and only send them when they are fetched by PHP?
>
> The reason I ask this is that I only want the first row of a query and
> wanted to know if I should use LIMIT, or whether the way PHP interacts with
> MySQL already acts like LIMIT is in place?
>
If you only want the first row of a result, use LIMIT as this will save
the mysql daemon from having to retrieve more than one row.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA