Re: mysql_fetch_array() VS mysql_result()
| From: | Matt McClanahan | Date: | Wed, 07 Jun 2000 20:22:48 +0000 |
| Subject: | Re: mysql_fetch_array() VS mysql_result() | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1250@lists.php.net to get a copy of this message | ||
On Wed, 7 Jun 2000, Svetlin Simeonov wrote:
> Hi,
>
> I read that mysql_fetch_array() is more fast than mysql_result() but I
> don't know whether my script will work ?
> I want to use it in queries wich will return more than 1 row , But in
> docs I can't find that mysql_fetch_array can read specified line number
> ... lets say 38
>
> In mysql_result I can say:
>
> mysql_result($conn_to_sql, $rownum, "column");
>
> Can I use in this situation MySQL_Fetch_Array(); ???
No, and that's why mysql_fetch_array is faster. :) This operation that
mysql_result does is extremely resource intensive. IMHO, in most cases,
you're better off using mysql_fetch_array or mysql_fetch_result and
iterating through the result until you find the field you're looking for.
Matt