error message: oci_fetch_array() expects parameter 1 to be resource, boolean given in /url_fns.php on line 17
I want to get all bm_URL record and store in $url_array. echo $r is shown to be 1. How to fix this error message?
$conn = db_connect();
$result = oci_parse($conn, "select bm_URL
from bookmark
where username = '$username'");
if (!$result){
$err = oci_error();
exit;
}
$r = oci_execute($result);
if (!$r) {
$error = oci_error($conn);
exit;
}
//create an array of the URLs
$url_array = array();
for($count = 1; $row = oci_fetch_array($r); ++$count) // error
{
$url_array[$count] = $row[0];
}
return $url_array;