DataObjects

From: Date: Wed, 14 Feb 2007 17:25:20 +0000
Subject: DataObjects
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26573@lists.php.net to get a copy of this message
utilising query: I thought this looked right - when I use it I only get the data from the TBL_SMS_CENTER_CHAT_DETAILS table - this makes sense I have used $sql throughout. How do I go about acheiving what I want in DataObjects? Or should I go straight through MDB2? // Query to get the users details and messages sent. DB_DataObject::debugLevel(0); $sql = DB_DataObject::factory(TBL_SMS_CENTER_CHAT_DETAILS); $sql1 = DB_DataObject::factory(TBL_SMS_CENTER_SERVICES); $sql2 = DB_DataObject::factory(TBL_SMS_CENTER_IN); $sql3 = DB_DataObject::factory(TBL_SMS_CENTER_PREMIUM); $_GET['cid'] = 2; $sql->query("(SELECT A.name, A.cli, A.location, A.dob, A.age,
                    A.starsign, A.sex, A.partner, A.mstatus, A.notes,
                    C.message, C.creation_date AS date, 'IN', C.action AS status
               FROM " . $sql->__table . " A, " . $sql1->__table . " B, " . $sql2->__table . " C
              WHERE A.detail_id = '" . $_GET['cid'] . "'
                AND A.cli = C.cli
                AND B.service_id = C.service_id
                AND B.type = 'Chat')
              UNION
            (SELECT A.name, A.cli, A.location, A.dob, A.age,
                    A.starsign, A.sex, A.partner, A.mstatus, A.notes,
                    C.message, C.creation_date AS date, 'OUT', C.status
               FROM " . $sql->__table . " A, " . $sql1->__table . " B, " . $sql3->__table . " C
              WHERE A.detail_id = '" . $_GET['cid'] . "'
                AND A.cli = C.cli
                AND B.service_id = C.service_id
                AND B.type = 'Chat')
           ORDER BY date DESC");
$total = $sql->find(); $sql->fetch(); Cheers Ian

« previous php.pear.general (#26573) next »