on 6/21/01 2:23 PM, wflow at [EMAIL PROTECTED] wrote:

>>> 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'.

> does NOT return an enumerated array, as the top line of the page states. It
> ONLY returns an associative array.
> If there was an ifx_fetch_array like the one for MySQL, I would not have to
> even post this question.

Please Note:  I don't use Informix, but the following is an educated guess.

Even though it isn't an enumerated array, you should be able to get the
value using the name of the key.  For example, to set your new query, you
would have something like:

/* DB Connect stuff precedes this as in example on:
http://php.net/manual/en/function.ifx-fetch-row.php */

while ifx_fetch_row($rid) {

    $my_new_query =
    'SELECT * FROM shipping WHERE orderdate = "' . $row['orderdate'] . '"';

    /* Now, take that query and do something with it.  Call ifx_query or


You could also just go through all the results in a similar fashion and set:

$orderdate = $row['orderdate'];
$ordertotal = $row['ordertotal'];

Hope that helps.


Paul Burney

Paul Burney
Webmaster && Open Source Developer
(310) 825-8365

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]

Reply via email to