Hi All !

    I need to keep two resultsets opened at the same time... on Ingres.
The records of the outter recordset are used to execute the inner query.

    I will explain in more detail...

    Example 1

***********************************************************************
     $sql  = " select * from dummy ";

     $db = ingres_connect ("guitar::rulez");

     ingres_query($sql,$db);

     while ($outter_resultset = ingres_fetch_array(INGRES_BOTH,$db))
     {
          echo 'hello...';
     }

***********************************************************************
    In example 1, the query is returning 2 rows... and writing 'hello'
twice... It's Ok...

    but....

    Example 2

***********************************************************************
     $sql  = " select * from dummy ";

     $db = ingres_connect ("guitar::rulez");

     ingres_query($sql,$db);

     while ($outter_resultset = ingres_fetch_array(INGRES_BOTH,$db))
     {
         $sql  = " select * from son_of_dummy where cod=" .
$outter_resultset ["cod"];

         $db1 = ingres_connect ("guitar::rulez");

         ingres_query($sql,$db1);

         $inner_resultset = ingres_fetch_array(INGRES_BOTH,$db);

          echo 'hello';
     }

***********************************************************************

    In the example 2, the outter query returns the first row (of 2)...
and then runs the inner query... The inner query returns only 1 row...
ok... But now, the while loop should run once more to get the second row
(the outter query should return 2 rows).. but it stops... !!! The
execution of the inner query prevents the outter query to get more
rows... The solution I found for a while is to run the outter query, and
put all the rows in an array... and then run over this array, and then
run the inner query for eache row of the array.... (it sucks!!!)

      Does PHP have support for multiple opened connections to the
Ingres database???? Or does it have support for resultsets????

        Thanks in advance!!
        Christian



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to