Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Can't get a value in my $variable

Can't get a value in my $variable

From: Dave <stephane.vollet_at_bluewin.ch>
Date: Sun, 9 Apr 2006 16:42:48 +0200
Message-ID: <44391d68_3@news.bluewin.ch>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US