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