Codeigniter Full Outer Join Example

This tutorial will show you how we can use Codeigniter’s Query Builder Class to build join queries for fetching data from multiple tables.

The purpose of a join is to combine the data across tables.
A join is actually performed by the where clause which combines the specified rows of tables.
If a join involves in more than two tables then first two tables are joined based on the join condition and then compares the result with the next table and so on.

Here we will see Full Outer Join example. Outer join gives the non-matching records along with matching records. Full Outer Join will display the all records from both tables.

MySQL does not support Full Outer Join but we will simulate full outer join using Union query. Codeigniter’s Active Record does not support Union query so we will use db->query() to get results from MySQL.

Read also Codeigniter Right Outer Join Example ,  Codeigniter Left Outer Join Example and Codeigniter Join Example

Continue reading “Codeigniter Full Outer Join Example”

Codeigniter Right Outer Join Example

This tutorial will show you how we can use Codeigniter’s Query Builder Class to build join queries for fetching data from multiple tables.

The purpose of a join is to combine the data across tables.
A join is actually performed by the where clause which combines the specified rows of tables.
If a join involves in more than two tables then first two tables are joined based on the join condition and then compares the result with the next table and so on.

Here we will see Right Outer Join example. Outer join gives the non-matching records along with matching records. Right Outer Join will display the all matching records and the records which are in right hand side table those that are not in left hand side table.

We will use Codeigniter’s $this->db->join() that permits you to write the JOIN portion of your query.

Read also Codeigniter Full Outer Join Example ,  Codeigniter Left Outer Join Example and Codeigniter Join Example

Continue reading “Codeigniter Right Outer Join Example”

Codeigniter Join Example

This tutorial will show you how we can use Codeigniter’s Query Builder Class to build join queries for fetching data from multiple tables.

The SQL Join clause is used to combine records together from two or more tables in a database. A JOIN locates related column values in two or more tables. This will display all the records that have matched. Join and Inner Join are functionally equivalent, but INNER JOIN can be a bit clearer to read, especially if the query has other join types (i.e. LEFT or RIGHT or CROSS) included in it. Here we will see Join or Inner Join example.

We will use Codeigniter’s $this->db->join() that permits you to write the JOIN portion of your query.

Read also Codeigniter Full Outer Join Example ,  Codeigniter Right Outer Join Example and Codeigniter Left Outer Join Example

Prerequisites

Netbeans 8.1
XAMPP in Windows
Codeigniter 3.0.6

Continue reading “Codeigniter Join Example”