[phplib] DB Connections and the table class From: Gerry W. Paterson (g.w.paterson <email protected>)
Date: 11/30/00

Hi,

I was starting to have a look at the table class and was wondering if its
possible to issue 2 queries to the same database object. Using the code below
I get the following error. However if I replace show_table_rows_result
with a while loop, or create a new database object things work ok. Can someone
please tell me if this is what is supposed to happen or if there is something
wrong with my setup, or any other suggestions...

Thanks,
Gerry

P.S. I'm using mod_php, phplib 7.2b, Oracle v7.3.4 on (sparc) Solaris 2.6

RESULTS
=======
Paterson Gerry Watson William Buchan Jim Grant Bill
End of Q1

Warning: Invalid cursor index 2 in db_oracle.inc on line 131
Warning: Bad Oracle connection number (2) in db_oracle.inc on line 131
Warning: Invalid cursor index 2 in db_oracle.inc on line 132
Warning: Bad Oracle connection number (2) in db_oracle.inc on line 132
Database error:
ora_parse() failed:
select surname,forename from contacts
Snap & paste this to sqlplus!
Oracle Error: ()
Session halted.

CODE
====
<?php
$t = new Table;
$db = new DB_nab;

  $db->query("select surname,forename from contacts");
  $t->show_table_rows_result($db);
  /*while($db->next_record()){
    printf("%s <P>",$db->f("surname"));
    }
 */
?>
<BR>End of Q1 <P> <TABLE>
<?php
  // $db2 = new DB_nab;
  $new_q="select surname,forename from contacts";
  $db->query($new_q);
  while($db->next_record()){
    echo "<TR><TD>";$db->p("surname");
  }
?>
 </TABLE>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>