Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Can't get a value in my $variable
Hello everyone,
I am trying to get the result of a query in a php variable I wander what's wrong with this code because I don't get a value in $val, I am sure my select is correct as it returns a value in SQL worksheet for instance.
<?php
$val = 'test';
print "value = $val <br>";
$con=oci_connect("dave","test",$bd_name);
$sql="select fruit_name from fruits where fruit_id=2";
$stmt=oci_parse($con,$sql);
oci_execute($stmt, oci_default);
oci_fetch($stmt);
$val = oci_result($stmt,0);
oci_free_statement($stmt);
print "value = $val ";
?> Received on Sun Apr 09 2006 - 09:42:48 CDT