File: sql4array.example.php

Recommend this page to a friend!
  Classes of Sylvain Rabot  >  sql4array  >  sql4array.example.php  >  Download  
File: sql4array.example.php
Role: Example script
Content type: text/plain
Description: Example
Class: sql4array
Query PHP arrays using an SQL dialect
Author: By
Last change: nothing
Date: 13 years ago
Size: 904 bytes
 

Contents

Class file image Download
<?PHP


/*
 * Project: Absynthe sql4array
 * File: sql4array.example.php5
 * Author: Absynthe <sylvain@abstraction.fr>
 * Webste: http://absynthe.is.free.fr/sql4array/
 * Version: alpha 1
 * Date: 30/04/2007
 * License: LGPL
 */

header("Content-type: text");

require
"./sql4array.class.php";


for (
$i = 0; $i < 20; $i++)
{
   
$array[$i][id] = rand(0, 20);
   
$array[$i][foo] = md5(rand(0, 10000));
}


$sql = new sql4array();
$a = $sql->query("SELECT id, foo FROM array");
$b = $sql->query("SELECT id, foo FROM array WHERE id > 10");
$c = $sql->query("SELECT id AS i, foo AS f FROM array WHERE i > 10");
$d = $sql->query("SELECT id AS i, foo AS f FROM array WHERE i > 10 AND f LIKE '%a%'");
$e = $sql->query("SELECT id AS iiiiii, foo AS fooooooooo FROM array WHERE iiiiii != 10");

var_dump($a);
var_dump($b);
var_dump($c);
var_dump($d);
var_dump($e);

?>


For more information send a message to info at phpclasses dot org.