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 majid ramzani  >  DB MySQL Class  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example script
Class: DB MySQL Class
Connect and query MySQL databases
Author: By
Last change:
Date: 2012-04-14 07:44
Size: 1,043 bytes
 

Contents

Class file image Download
<?php 

 
/******************************************************************

   Projectname:   Mysql DataBase Class
   Version:       1.00
   Author:        MAJID RAMZANI 
   
   site : http://majidramzani.com

   Last modified: 14. April 2012

   * GNU General Public License (Version 2, June 1991)
   *
   * This program is free software; you can redistribute
   * it and/or modify it under the terms of the GNU
   * General Public License as published by the Free
   * Software Foundation; either version 2 of the License,
   * or (at your option) any later version.
   *
   email  : majideramzani@gmail.com   

  ******************************************************************/
 
 
 
 
 // include class :
require_once "db.class.php";

//creat a db object
$con=new db;

//run the query:
$con->query("select * from table ");

//get number of result
echo $con->num() . PHP_EOL;

//get result
echo $con->result(/* $index */) . PHP_EOL;

//get all result
while($row=$con->assoc()) var_dump($row);