PHP Classes

File: example1.php

Recommend this page to a friend!
  Classes of Pineapple Technologies  >  EZ Select  >  example1.php  >  Download  
File: example1.php
Role: ???
Content type: text/plain
Description: example 1
Class: EZ Select
Author: By
Last change:
Date: 15 years ago
Size: 924 bytes


Class file image Download
// example1.php
// using EZ Select to generate queries based on some user input.


$my_query = new ez_select();

// we want to select from "foo" and "bar" tables

// add the fields we want to select

// where clauses to restrict our query
$my_query->add_where_clause(" =");
$my_query->add_where_clause(" != 'foobar'");

// order by, then RAND()


// get first 25 results
$my_query->set_limit(0, 25);

// show our query

// at this point you would run the query through mysql_query() or whatever
// $result = mysql_query( $my_query->make() );