simple php-oracle query problem
781646Jun 28 2010 — edited Jul 5 2010hi all,
i'm new to php oracle. I'm not sure about my query. I try to echo stack of data from a table. However, it will only preview one data. But i'm not sure how to make them view all of my data. My codes is like this:
$conn = oci_connect('abc','abc123','00/sid');
if (!$conn) {
trigger_error("Could not connect to database", E_USER_ERROR);
}
$query = " select * from ANNOUNCEMENTS ";
$stid = oci_parse($conn, $query);
$result = oci_execute($stid, OCI_DEFAULT);
$row = oci_fetch_array($stid, OCI_ASSOC);
$nrows = oci_num_rows($stid);
if (!$nrows) {
No Records!
<?php
}
else
{
?>
<table width="671" border="1" bordercolor="#666666">
<tr>
<td>News</td>
<td>Dates</td>
</tr>
<?php
for ($x = $nrows; $x>0; $x--){
?>
<tr>
<td><?php echo $row["NEWS"];?></td>
<td><?php echo $row["DATE"];?></td>
</tr>
<?php
}
OCIFreeStatement($stid); ?>
please help me out, ;(