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 -> Re: Oracle and PHP question

Re: Oracle and PHP question

From: noone <noone_at_nowhere.com>
Date: Fri, 10 Mar 2006 19:26:49 GMT
Message-ID: <cc4c850abc794a4376de21cab7cbd0d5$1@www.firstdbasource.com>


Steff wrote:

> Hello everyone,

> I am trying to display in an array the result of a query. Unfortunately I
> cannot concatenate 2 fields
> in 1, it makes an error :

> Warning: ociexecute() [function.ociexecute]: ORA-00911: Caractère non valide
> in
> c:\pageWeb\tasks_to_do.php on line 103

> Fulfiller Request Type Task Name Start Date End Date Expected Delivery date
> Client
> Warning: ocifetchinto() [function.ocifetchinto]: ORA-24374: définition non
> exécutée
> après extraction ou exécution et extraction in c:\pageWeb\tasks_to_do.php on
> line 117

> if I use query without the concatenate operator it works... but I need to
> concatenate
> those fields though...

> Can anyone help me out?

> here is my code:

> <?php

> // connexion
> $conn = ocilogon("stephane","Stef1975",$bdtest05);
> // préparation du Select
> $query="select a.fulfiller_firstname|| ' '||a.fulfiller_lastname
> ,b.request_type_name
> ,c.task_name
> ,c.task_start_date
> ,c.task_end_date
> ,d.request_wished_delivery_date
> ,e.client_firstname||' '||e.client_lastname
> from fulfillers a
> ,request_types b
> ,tasks c
> ,requests d
> ,clients e
> where c.task_fulfiller_id = a.fulfiller_id
> and c.task_request_id = d.request_id
> and d.request_request_type_id = b.request_type_id
> and d.request_client_id = e.client_id;";

> $ordre = OCIParse ($conn, $query);
> OCIExecute ($ordre);
> $ncols = OCINumCols($ordre);
> // affiche les lignes tant qu'il y en a
> // et les colonnes une par une
> print "<TABLE BORDER=1> ";
> print "<TR>";
> print "<TD>Fulfiller</TD>";
> print "<TD>Request Type</TD>";
> print "<TD>Task Name</TD>";
> print "<TD>Start Date</TD>";
> print "<TD>End Date </TD>";
> print "<TD>Expected Delivery date</TD>";
> print "<TD>Client</TD>";

> while (OCIFetchInto ($ordre, $ligne, OCI_NUM)) {
> print "<TR> ";
> for ( $i=0;$i < $ncols; $i++) {
> print "<TD> $ligne[$i] </TD>" ;
> }
> print "</TR> ";
> }// libere les ressources
> OCIFreeCursor ($ordre);
> OCILogoff($conn);
> ?>

Try changing:
$query="select a.fulfiller_firstname|| ' '||a.fulfiller_lastname

to

$query="select a.fulfiller_firstname|| ' '||a.fulfiller_lastname as fulfillnm

and

       ,e.client_firstname||' '||e.client_lastname to

       ,e.client_firstname||' '||e.client_lastnam as clientname Received on Fri Mar 10 2006 - 13:26:49 CST

Original text of this message

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