Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > 3c81c2ef4f93f62199f9086acbf02ded > files > 18

ezcomponents-Database-1.4.7-3.mga4.noarch.rpm

<?php

$db = ezcDbInstance::get();

$q = $db->createSelectQuery();

// Right join of three tables. Will produce SQL:
// "SELECT id FROM table1 RIGHT JOIN table2 ON table1.id = table2.id RIGHT JOIN table3 ON table2.id = table3.id".
$q->select( 'id' )
        ->from( 'table1' )
            ->rightJoin( 'table2', 'table1.id', 'table2.id' )
            ->rightJoin( 'table3', 'table2.id', 'table3.id' );

$stmt = $q->prepare();
$stmt->execute();


?>