--- Anthony Ritter <[EMAIL PROTECTED]> wrote:
> When using mysql_fetch_array() is it necsessary to specify the
> second argument - meaning the constant of MYSQL_NUM or
> MYSQL_ASSOC?

Whenever you have a question about a function, you can look it up using a
URL formatted as follows:

http://www.php.net/mysql_fetch_array

Here, you will see:

"The optional second argument result_type  in mysql_fetch_array() is a
constant and can take the following values: MYSQL_ASSOC, MYSQL_NUM, and
MYSQL_BOTH. This feature was added in PHP 3.0.7. MYSQL_BOTH is the default
for this argument.

By using MYSQL_BOTH, you'll get an array with both associative and number
indices. Using MYSQL_ASSOC, you only get associative indices (as
mysql_fetch_assoc() works), using MYSQL_NUM, you only get number indices
(as mysql_fetch_row() works)."

Hope that helps.

Chris

=====
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
     Coming Fall 2004
HTTP Developer's Handbook - Sams
     http://httphandbook.org/
PHP Community Site
     http://phpcommunity.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to