DB driven menu
Posted: Mon Oct 14, 2002 7:31 am
Could anybody help with code or link to a Oracle/PHP driven dropdown menu.
Very hard to find - so please help !

Very hard to find - so please help !
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$conn = OCILogon($_POSTї"user"],$_POSTї"passwd"],$_POSTї"conn_str"]);
$stmt = OCIParse($conn, "select * from cat");
OCIExecute($stmt);
$nrows = OCIFetchStatement($stmt,$results);
if ( $nrows > 0 ) {
print "<FORM action=proc.php method="post">\n";
print "<SELECT>\n";
while ( list( $key, $val ) = each( $results ) ) {
for ( $i = 0; $i < $nrows; $i++ ) {
reset($results);
while ( $column = each($results) ) {
$data = $columnї'value'];
print "<OPTION>$dataї$i]</OPTION>\n";
}
}
}
print "</SELECT>\n";
print "</FORM>\n";
}
else {
echo "<BR>This schema hasn't any cat object.\n";
}
OCIFreeStatement($stmt);
OCILogoff($conn);
?>