我有一个用户数据库表,其中有两个字段USER_ID和USER_DESCRIPTION,如果我运行下面的代码,我会得到一个以数组形式表示的结果。
Array ( [USER_ID] => 1 [USER_DESCRIPTION] => TAB )
但我希望按照索引0、1的方式访问这些值。如何实现呢?
while (($result = oci_fetch_array($data, OCI_ASSOC)) != false) {
echo $result['USER_ID']. ' - ' .$result['USER_DESCRIPTION']; //This works
echo $result[0]. ' - ' .$result[1]; //This is how i want to access the values
}