Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

cake php 2.x joins

$this->Message->find('all', array(
    'joins' => array(
        array(
            'table' => 'users',
            'alias' => 'UserJoin',
            'type' => 'INNER',
            'conditions' => array(
                'UserJoin.id = Message.from'
            )
        )
    ),
    'conditions' => array(
        'Message.to' => 4
    ),
    'fields' => array('UserJoin.*', 'Message.*'),
    'order' => 'Message.datetime DESC'
));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #cake #php #joins
ADD COMMENT
Topic
Name
6+9 =