PHP Classes

File: examples/sql/example_join.php

Recommend this page to a friend!
  Classes of Haseeb Ahmad Basil   PHP Skeleton Framework   examples/sql/example_join.php   Download  
File: examples/sql/example_join.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Skeleton Framework
Extensive Web application development framework
Author: By
Last change:
Date: 8 years ago
Size: 800 bytes
 

Contents

Class file image Download
<?php
include 'config.php';

$select = new A_Sql_Select();
echo
$select
   
->columns()
    ->
from('tablefoo')
    ->
join('foo0', 'bar0', 'LEFT')
    ->
leftjoin('foo', 'bar')->on('foo1.column1', 'column2')->on('OR', 'column3', 'column4')
    ->
innerjoin('foo2', 'bar2')->on('column5', 'column6')
    ->
innerjoin('foo3', 'bar3')->on(array('column7' => 'column8', 'column9' => 'column10'))
    ->
where('foo', 'bar');
echo
"\n<br/>\n";

$select = new A_Sql_Select();
echo
$select
   
->columns()
    ->
from('tablefoo')
    ->
join('foo0', 'bar0', 'LEFT')->on('column5', "column6")
    ->
where('foo', 'bar');
echo
"\n<br/>\n";

$select = new A_Sql_Select();
echo
$select
   
->columns()
    ->
from('tablefoo')
    ->
join('foo0', 'bar0', 'LEFT')->on('column5', "'some value'")
    ->
where('foo', 'bar');
echo
"\n<br/>\n";