★ wanayoo — archive 1999 http://www.php.net/manual/it/function.msql-fetch-array.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to mSQL
Quick Reference
English version of this pageGerman version of this pageJapanese version of this pageFrench version of this pageHungarian version of this page
mSQL
* msql
* msql_affected_rows
* msql_close
* msql_connect
* msql_create_db
* msql_createdb
* msql_data_seek
* msql_dbname
* msql_drop_db
* msql_dropdb
* msql_error
* msql_fetch_array
* msql_fetch_field
* msql_fetch_object
* msql_fetch_row
* msql_fieldname
* msql_field_seek
* msql_fieldtable
* msql_fieldtype
* msql_fieldflags
* msql_fieldlen
* msql_free_result
* msql_freeresult
* msql_list_fields
* msql_listfields
* msql_list_dbs
* msql_listdbs
* msql_list_tables
* msql_listtables
* msql_num_fields
* msql_num_rows
* msql_numfields
* msql_numrows
* msql_pconnect
* msql_query
* msql_regcase
* msql_result
* msql_select_db
* msql_selectdb
* msql_tablename
Manual: msql_fetch_array
View the source code for this pageSearch the site



Previous page
 msql_error
 Updated
Sun, 06 Aug 2000
msql_fetch_field 
Next page


msql_fetch_array

(PHP3 , PHP4 )

msql_fetch_array -- Fetch row as array

Description

int msql_fetch_array (int query_identifier [, int result_type])

Returns an array that corresponds to the fetched row, or false if there are no more rows.

msql_fetch_array() is an extended version of msql_fetch_row(). In addition to storing the data in the numeric indices of the result array, it also stores the data in associative indices, using the field names as keys.

The second optional argument result_type in msql_fetch_array() is a constant and can take the following values: MSQL_ASSOC, MSQL_NUM, and MYSQL_BOTH.

Be careful if you are retrieving results from a query that may return a record that contains only one field that has a value of 0 (or an empty string, or NULL).

An important thing to note is that using msql_fetch_array() is NOT significantly slower than using msql_fetch_row(), while it provides a significant added value.

For further details, also see msql_fetch_row().


User Contributed Notes: msql_fetch_array


scentre@one.net.au
23-Jul-2000 09:32


Here is the format for getting something out of an msql_fetch_array.



while($row = msql_fetch_array($result)) {

echo $row["client_id"];

echo $row["fullname"];

}



plus....

$client_id = $row["client_id"];

$fullname = $row["fullname"];



So that you don't have to go through the same bloody problems I did...

and in case I forget...



Brian






scentre@one.net.au
23-Jul-2000 02:30
In addition to format... forgot to show getting array data by fieldname.



This is the format... The difference is... No Quotation (") marks.

echo $row[client_id];

echo $row[fullname];



Brian






 About Notes


Previous page
 msql_error
 Updated
Sun, 06 Aug 2000
msql_fetch_field 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.