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 martin barker  >  SQL Store  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Shows how to use the Script
Class: SQL Store
Execute SQL queries stored in a database
Author: By
Last change: Updated to provide new information and work with the new class thats about to be uploaded
Date: 2008-12-11 09:56
Size: 845 bytes
 

Contents

Class file image Download
<?php
require('sql.cls.php');
/*
This class is a sql class that prevents reruns of qerys
How this works is when ever a query is run it stores it and
store the raw sql output then if a project uses this sql all the way thoughout
the running of the application it will prevent the rerun of querys using
the raw SQL Stored lowering load times and mysql flooding
*/

//define connection using standard port 3306
$sql = new sql('host','username','password','database');
//define connection using another port
//$sql = new sql('host','username','password','database','port');

// Set a Query to run
$sql->set_query('SELECT * FROM `TEST`');

// Get the data from the query using fetch assoc
$sql->fetch_assoc();

// Get the data from the query using fetch array
$sql->fetch_array();

// Run Standad query
$sql->query();

?>