在我发布这个问题之前,我从Google收到了一些答案,但我发现他们有些混乱.我在互联网上发现的一些链接如下.
我从上面的答案中得不到准确的想法.那么他们之间究竟有什么区别呢?
MysqL_fetch_array ( resource $result [,int $result_type = MysqL_BOTH ] )
Returns an array of strings that corresponds to the fetched row,or
FALSE if there are no more rows. The type of returned array depends on
how result_type is defined. By using MysqL_BOTH (default),you’ll get
an array with both associative and number indices. Using MysqL_ASSOC,
you only get associative indices (as MysqL_fetch_assoc() works),[by] using
MysqL_NUM,you only get number indices (as MysqL_fetch_row() works).
MysqL_fetch_row ( resource $result )
Returns an numerical array of strings that corresponds to the fetched
row,or FALSE if there are no more rows.MysqL_fetch_row() fetches one row of data from the result associated
with the specified result identifier. The row is returned as an array.
Each result column is stored in an array offset,starting at offset 0.
综上所述
MysqL_fetch_array($result,MysqL_ASSOC)= MysqL_fetch_assoc($result)
MysqL_fetch_array($result,MysqL_NUM)= MysqL_fetch_row($result)
和
MysqL_fetch_array($result)= MysqL_fetch_assoc($result)MysqL_fetch_row($result)