Hello. How can i write this query with Criteria ?

$sql = "SELECT Chat.SENDER, Chat.RECIEVER FROM Chat WHERE Chat.OWNER=38 AND 
Chat.SENDER NOT IN(14) AND Chat.SENDDT>='2008-08-20 10:19:06' AND 
Chat.STAT='0' GROUP BY Chat.SENDER"

This $sql works. When i try it with Criteria it is not working.

What is the problem ?
I guess problem is with
Chat.SENDER NOT IN(14)   =>  $c->add(ChatPeer::SENDER, $rsender, 
Criteria::NOT_EQUAL );

How can i correct the mistake ? Thanks.



    $c = new Criteria();
    $c->addSelectColumn(MinchatPeer::R);
    $this->minrs = ChatPeer::doSelectRS($c);
    $rsender = array();

    while ($this->minrs->next())
    {
                $rsender[] = $this->minrs->getInt(1);
   }

    $c = new Criteria();
    $c->clearSelectColumns();
    $c->addSelectColumn(ChatPeer::SENDER );
    $c->add(ChatPeer::SENDER, $rsender, Criteria::NOT_EQUAL );
    $c->add(ChatPeer::SENDDT ,date('Y-m-d H:i:s',strtotime("now -$check 
minutes")),Criteria::GREATER_EQUAL );
    $c->add(ChatPeer::STAT , '0');
 

__________________________________________________
Yahoo! kullanıyor musunuz?
İstenmeyen postadan bıktınız mı?  Yahoo! Posta'da piyasanın en iyi istenmeyen 
posta korunması var 
http://tr.mail.yahoo.com 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to