Re: [PHP-DB] Informix Question how to put data from query into variables

2001-06-21 Thread Christian Haul

wflow [EMAIL PROTECTED] wrote:
 Hi All,

 What I want to do is create another query from some of the data from another
 one. The question is how do I take the data I get back from my first query
 and put that into variables so I can build my second query. The example I
 have in mind is:

 I a do a select tracknum,orderdate,ordertotal,status,shipdate from orders
 where tracknum = '$trknum' and I want the data returned into vars: like
 orderdate = $orderdate so I can create a new query like: select * from
 shipping where orderdate = '$orderdate'.

 @ifx_htmltbl_result($sql_result,border=1);

You might want to consider reading the php manual, especially the part on functions
and even more the one on informix functions. There you'll find a function 
called ifx_fetch_row. 

Chris.

-- 
PHP Database 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]




[PHP-DB] Informix Question how to put data from query into variables

2001-06-20 Thread wflow

Hi All,

What I want to do is create another query from some of the data from another
one. The question is how do I take the data I get back from my first query
and put that into variables so I can build my second query. The example I
have in mind is:

I a do a select tracknum,orderdate,ordertotal,status,shipdate from orders
where tracknum = '$trknum' and I want the data returned into vars: like
orderdate = $orderdate so I can create a new query like: select * from
shipping where orderdate = '$orderdate'.

HTML

!-- doit.php --BODY

H1Please enter your Tracking Number: /H1


FORM action=http://sqa/doit.php;

INPUT NAME=trknum BR

INPUT type = submit value = Execute

/FORM

/BODY



?php

define(DBG,1);

$connection = ifx_connect(fra3x@ol_unit,foo,bar)

or die(Couldn't create connection.);

$sql = select tracknum,orderdate,ordertotal,status,shipdate from orders
where tracknum = '$trknum';

$sql_result = ifx_query($sql,$connection);

@ifx_htmltbl_result($sql_result,border=1);

ifx_free_result($sql_result);

ifx_close($connection);

ifx_close();}

?






-- 
PHP Database 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]