Search an Oracle table in PHP -
i've written page tries search oracle database. can't see i've gone wrong. can't result display, despite changing query "select * table book_name="..." (guaranteed return result).
$query = "select * books book_name = 'my life'"; $dbuser = "username..."; $dbpass = "password..."; $db = "ssid"; $connect = oci_connect($dbuser, $dbpass, $db); if (!$connect) { echo "an error occurred connecting database"; exit; } $stmt = oci_parse($connect, $query); if(!$stmt) { echo "an error occurred in parsing sql string.\n"; exit; } oci_execute($stmt); ?> html... <?php while(oci_fetch_array($stmt)) { $fg1 = oci_result($stmt,"book_name"); echo ($fg1); $fg2 = oci_result($stmt,"author"); echo ($fg2); $fg3 = oci_result($stmt,"price"); echo ($fg3); $fg4 = oci_result($stmt,"image_location"); echo ("<br><img src=my url...".$fg4."><br>"); } ?>
i've made sure oracle table correct also. help.
update: appears between while(oci_fetch_array($stmt)) {
part not execute.
Comments
Post a Comment