Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Oracle oci_num_rows result 0

I have a question about query in Oracle :

The problem is, the result of oci_num_rows is always 0.

and here is my code so far :

  $query = "SELECT IP_ADDRESS, STATUS FROM SEIAPPS_IP_ADDRESS WHERE IP_ADDRESS='$ip'";
  $result = oci_parse($c1, $query);
  oci_execute($result);
  echo $found = oci_num_rows($result);

To make it sure, I try to clear the condition "WHERE IP_ADDRESS='$ip'". Still same with the result is 0 whereas in my table there are some data.

Any advice ?

like image 854
Asean Jazz Avatar asked May 20 '26 00:05

Asean Jazz


1 Answers

Use this:

$query = "SELECT IP_ADDRESS, STATUS FROM SEIAPPS_IP_ADDRESS WHERE IP_ADDRESS='$ip'";
$result = oci_parse($c1, $query);
oci_execute($result);
$numrows = oci_fetch_all($result, $res);
echo $numrows." Rows";
like image 129
Code Lღver Avatar answered May 21 '26 15:05

Code Lღver