what different between

A

Anonymous

Guest
hi
i read in php manual this functions

Code:
mysql_fetch_array()
mysql_fetch_assoc()
mysql_fetch_field()
mysql_fetch_lengths()
mysql_fetch_object()
but i don't know different using between them
please tell the different
 
mysql_fetch_array -- Fetch a result row as an associative array, a numeric array, or both. The type of array that is to be fetched. It's a constant and can take the following values: MYSQL_ASSOC, MYSQL_NUM, and the default value of MYSQL_BOTH. i.e. mysel_fetch_array($result, MYSQL_ASSOC) for associative array, mysel_fetch_array($result, MYSQL_NUM) for numeric index, mysel_fetch_array($result, MYSQL_BOTH) returns both a numeric and associative index array. This one defaults to both

mysql_fetch_assoc -- Returns an associative array using the field names as the index. same as mysql_fetch_array($result, MYSQL_ASSOC)

mysql_fetch_row -- Returns a numerical index array of the current result row. same as mysql_fetch_array($result, MYSQL_NUM)

mysql_fetch_field -- Get column information from a result and return as an object see http://www.php.net/mysql_fetch_field for more info

mysql_fetch_lengths -- Get the length of each output in a result. see http://www.php.net/mysql_fetch_lengths for more info

mysql_fetch_object -- Fetch a result row as an object. similar to mysql_fetch_assoc but it stores the results into an object asseccable with $foo->field_name.


The manual has better explaination.. you should check it out. http://www.php.net/manual
 
Back
Top