Ragnar wrote:
Check (echo) the query string to see if it is properly formated.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
If so, see if the "=" sign is the best one for your comparison. Sometimes it isn't...
Luis
-- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php