Dingo Framework

Dingo is a Rapid Development Application Framework written in PHP. Dingo allows you to create dynamic changing websites easily and quickly.

Database Join

Dingo supports basic JOIN queries. Suppose you have two tables, users and friends, that have the following rows:

Join Query Tables

You could run a simple JOIN query on these tables like so:

// Select the users table
$table = db('mytable');

$res = $table->select('*')
             ->where('id','=',1)
             ->join('friends')
             ->on('users.id','=','friends.user')
             ->execute();

print_r($res);

Notice the only difference between this query and a regular select is the addition of the join() and on() methods. The above would display something like the following:

Array
(
    [0] => Array
        (
            [id] => 1
            [name] => Evan
            [user] => 1
            [friend] => 2
        )

    [1] => Array
        (
            [id] => 1
            [name] => Evan
            [user] => 1
            [friend] => 3
        )

)

© 2008 - 2012 Evan Byrne