Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Johan De Klerk  >  jMySQL  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: jMySQL
Simple MySQL API
Author: By
Last change:
Date: 11 years ago
Size: 1,277 bytes
 

Contents

Class file image Download
<?php

/*
* jMySQL Example
* by Johan De Klerk (johan@wisi.co.za)
* Freely distributable
*/

require_once('jMySQL.php');
 
 
$j = new jMySQL('localhost','dbname','root');
 
$fields = array('name','surname');
$tables = array('details','country');

$conditions = array("name='name 1'","surname='surname 1'");
$orderby = array('name','surname','desc');
 
$j -> jSelect($fields,$tables,$conditions,$orderby,'','0,10',1);

echo 
$j -> getQuery(). '<br>';

$fields1 = array('name','surname');
$values1 = array('johan','de klerk');

$j -> jUpdate('details',$fields1,$values1,'id',2);

echo 
$j -> getQuery(). '<br>';

$fields2 = array('id','name','surname','countryId');
$values2 = array('null','johan','de klerk',3);

$j -> jInsert('details',$fields2,$values2);

echo 
$j -> getQuery(). '<br>';

$j -> jInsert('details','',"'null','name','surname',6");

echo 
$j -> getQuery(). '<br>';

$j -> jDelete('details','id',15);

echo 
$j -> getQuery(). '<br>';

$j -> jCreateHeap('heap_table'$j->jSelect('name,surname','details','','','','',5));

echo 
$j -> getQuery(). '<br>';

$j -> jEmptyTable('heap_table');

echo 
$j -> getQuery(). '<br>';

$j -> jDropTable('heap_table');

echo 
$j -> getQuery(). '<br>';
 
echo 
$j -> getErrors();
?>