The while
is looping over all returned rows. You are then foreach
ing across that row and accessing the columns in the row (don't do that). You just want the while
and access CART_NAME
in $row
:
while ($row = oci_fetch_array($custcart, OCI_ASSOC)) {
echo $row['CART_NAME'];
}
If you want to store the rows in an array to use more than once in the script, then:
while ($row[] = oci_fetch_array($custcart, OCI_ASSOC)) { }
//now or later
foreach ($row as $item) {
echo $item['CART_NAME'];
}