简体   繁体   中英

what kind of an array will mysql_fetch_array($result) fetch?

I want to fetch values from a table in a MySQL database into PHP.

What kind of array will mysql_fetch_array($result) return? Associative or numeric?

array mysql_fetch_array ( resource $result [, int $result_type = MYSQL_BOTH ] )

It depends on the second parameter which is default MYSQL_BOTH and could be MYSQL_ASSOC , MYSQL_NUM , and MYSQL_BOTH .

More info about mysql_fetch_array .

From the manual:

mysql_fetch_array — Fetch a result row as an associative array, a numeric array, or both

它返回包含数字和字符串索引的数组。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM