I have a page that pulls some data from a table:
this works fine as is, but I need to be able to specify the individual columns so I can do some formatting on them. I have found dozens of examples similar to the following that should do what I need, but I can NOT get any data to return using this example.
This is from the manual.
This is almost verbatim from the php manual, but i just can not get it to return any data. Can ANYBODY tell me what I'm doing wrong?
PHP:
while (($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) != false) {
echo "<tr>\n";
foreach ($row as $item) {
echo " <td>".($item !== null ? htmlentities($item, ENT_QUOTES) : " ")."</td>\n";
}
}
this works fine as is, but I need to be able to specify the individual columns so I can do some formatting on them. I have found dozens of examples similar to the following that should do what I need, but I can NOT get any data to return using this example.
This is from the manual.
PHP:
<?php
$connection = oci_connect("apelsin", "kanistra");
$query = "SELECT id, name FROM fruits";
$statement = oci_parse ($connection, $query);
oci_execute ($statement);
while ($row = oci_fetch_array ($statement, OCI_BOTH)) {
echo $row[0]." and ".$row['ID']." is the same<br>";
echo $row[1]." and ".$row['NAME']." is the same<br>";
}
?>
This is almost verbatim from the php manual, but i just can not get it to return any data. Can ANYBODY tell me what I'm doing wrong?
PHP:
while (($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) != false) {
echo "<tr>\n";
echo "<td>" .$row['OJBECT_ID'] . "</td>";
echo "<td>" .$row['OJBECT_NAME'] . "</td>";
echo "</tr>\n";