Jump to content

php oop database class, Need help, am learning


rudyten

Recommended Posts

need help. am learning php oop.

Logic below breaks when processing second parent. $db was defined a second time?

Suggestions? Do i need to define new database for child???

 

$db = new Database;
$Query = ('Select parentId from PARENT');
$db->query($Query);

while ($db->nextRecord()){
         $PARENT_ID			= $db->Record['PARENT_ID'];
         $PARENT_NAME		= $db->Record['PARENT_NAME'];
         
         $Query = ('Select * from CHILD where CHILD_PARENT_ID = $PARENT_ID');
         $db->query($Query);
         while ($db->nextRecord()){
               print  "child name: $db->Record['CHILD_NAME'];
         }
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.