I have a very big problem please. I installed Oracle on my Windows
Professional server. However, whenever I try to call the Oracle OIC connect
function, it tells me that the function is invalid. Please, I need to know
if there is anything I need to do to enable me to connect to the Oracle
server using PHP because I can connect to mySql on the same machine using
the same PHP function for mySQL.

Bikes

-----Original Message-----
From: Asendorf, John
To: Jean-Christophe Le Brun; [EMAIL PROTECTED]
Sent: 1/31/01 2:38 PM
Subject: RE: [PHP-WIN] Problem with Oracle 

Since the list was down yesterday, I figured it out before I got some
help
(Thanks Jean-Christophe).  I did it a little differently and thought I'd
post it here.

$sql_getID = "SELECT max(CUSTID_NUM) from cfull2.tbl_dl_customers";
$stmt_getID = OCIParse ( $connection , $sql_getID );
OCIExecute ( $stmt_getID );
OCIFetch ( $stmt_getID );
$Max_ID = OCIResult($stmt_getID,1);
OCIFreeStatement ( $stmt_getID );
$Max_ID++;

I was able to echo the result but was unable to put it in to a variable
until I did the above.
        

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631

The benefit to the government of replacing all $1 Federal Reserve notes
with
$1 coins would be $522.2 million per year, according to estimates of the
General Accouting Office released on April 7, 2000.


> -----Original Message-----
> From: Jean-Christophe Le Brun [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 31, 2001 2:19 AM
> To: Asendorf, John; [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] Problem with Oracle 
> 
> 
> Hi !
> 
> > I'm trying to run some SQL in Oracle that returns a single value...
> >
> > $sql_getID = "SELECT max(CUSTID_NUM) from cfull2.tbl_dl_customers";
> >
> > how the hell do I get that number into a variable?
> >
> > I've tried a dozen different things, but the documentation 
> is so sparse
> and
> > it's all about getting rows of data...
> 
> Do this :
> 
> $Requete = "SELECT max(CUSTID_NUM) MAX_ID from 
> cfull2.tbl_dl_customers";
> OCIDefineByName($Requete, "MAX_ID", &$Max_Id);
> OCIExecute($Requete, OCI_DEFAULT);
> while (OCIFetch($Requete))
> {
>   echo $Max_Id;
> }
> 
> the While is not necessary here cause your query send only one row...
> 
> if (OCIFetch($Requete))
> {
>   echo Max_Id;
> }
> 
> is better !
> 
> JCLB Soft
> Jean-Christophe Le Brun
> [EMAIL PROTECTED]
> http://www.multimania.com/jclb
> 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to