Search
 
SCRIPT & CODE EXAMPLE
 

PHP

cakephp 2.x join

$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'
));
Comment

PREVIOUS NEXT
Code Example
Php :: php fix array index 
Php :: laravel session 
Php :: delete all records from table using button laravel Eloquent 
Php :: read pdf text in php 
Php :: Fatal error: Allowed memory size of 1610612736 bytes exhausted 
Php :: php round to whole number 
Php :: how to call a helper function in blade 
Php :: brew downgrade php 8 to 7.4 
Php :: add class to body class wordpress 
Php :: break and continue in laravel 
Php :: laravel model exists id 
Php :: php date add days 
Php :: symfony call service in controller 
Php :: laravel username validation 
Php :: Syntax error or access violation: 1071 Specified key was too long; 
Php :: sending data from one website to another in php 
Php :: what is scalar data type in php 
Php :: clear laravel.log 
Php :: string to boolean php 
Php :: send html email laravel 
Php :: index.php wont load as main 
Php :: insert data using mysqli in php 
Php :: php How do you remove an array element in a foreach loop? 
Php :: php remove array element 
Php :: print only some characters of a string in php 
Php :: check if elquent retrun empty array laravel 
Php :: select sum laravel 
Php :: program logic for second largest number in an array in php 
Php :: php email attachment and message 
Php :: codeigniter 4 limit query 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =