是数组
如果是记录集,可以是0-N的也可以是字段名如果是show Tables这个命令,可以是下标可以是0,也可以是tables_in_(db),db就是数据库名称你可以通过这个程序测试
$query=@mysql_query($sql); while($rs=mysql_fetch_array($query))
{
foreach($rs as $key => $v)
echo "{$key}:{$v}<br />";
echo "--------------------------------------------------------<br />";
}
如果是记录集,可以是0-N的也可以是字段名如果是show Tables这个命令,可以是下标可以是0,也可以是tables_in_(db),db就是数据库名称你可以通过这个程序测试
$query=@mysql_query($sql); while($rs=mysql_fetch_array($query))
{
foreach($rs as $key => $v)
echo "{$key}:{$v}<br />";
echo "--------------------------------------------------------<br />";
}
array mysql_fetch_array ( resource $result [, int $result_type] )Returns an array that corresponds to the fetched row and moves the internal data pointer ahead.
Parametersresult The result resource that is being evaluated. This result comes from a call to mysql_query().
result_type 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. -----------------
也就是说,mysql_fetch_array($query, MYSQL_ASSOC) 相当于mysql_fetch_assoc
mysql_fetch_array($query, MYSQL_NUM) 相当于mysql_fetch_row