Re: PHP OOP

From: Date: Wed, 30 Jun 2004 23:13:59 +0000
Subject: Re: PHP OOP
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-24089@lists.php.net to get a copy of this message
I'm guessing your ibase_fetch_object($qry_result) call does not successfully retrieve any data. It then returns false and your calling script does nothing if false is returned. At 09:32 PM 30/06/2004, you wrote:
Hi lads, I'm just tinkering around in PHP again recently, I haven't done much OO in general, so I wasn't too surpised when some of the stuff I did today didn't work. Example: (DB abstraction): function data($qry_result){ if ($qry_result){
    return ibase_fetch_object($qry_result);
} } (Item function) function show_item($item) { $sublvl = $_GET['sub']; $qry_item = query("select ITMLIST.*, GRPLIST.NAME AS SUBNAME from ITMLIST, GRPLIST where ITMLIST.ITEM_ID=$item AND GRPLIST.GROUP_ID = ITMLIST.PARENT_ID AND ITMLIST.PARENT_ID = $sublvl"); $obj_item = data($qry_item); if ($obj_item){
    return $obj_item;
} } -------------------- Can someone tell me why I can't access the object that I want to have returned .. or rather why it seems to be empty. If I do <?= $obj_item->NAME ?> I don't get any output. It's possibly because I am trying something stupid, but I'd really like it if I could return that object, so I could output the bits that it has more conviently (in templates etc.) cheers, Ben -- +++ Jetzt WLAN-Router für alle DSL-Einsteiger und Wechsler +++ GMX DSL-Powertarife zudem 3 Monate gratis* http://www.gmx.net/dsl -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
. . Ross Honniball. JCU Bookshop Cairns, Qld, Australia. .

« previous php.windows (#24089) next »