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 Radek Piekarz  >  Simple MySQL Class  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example file
Class: Simple MySQL Class
Simple MySQL database access wrapper
Author: By
Last change:
Date: 2006-02-06 12:32
Size: 717 bytes
 

Contents

Class file image Download
<?php
require_once('class.php');
#connecting to mysql server
$dbc = new dbconnect('localhost''root''password''database'__FILE____LINE__);


#using imple query and fetch_array method
$query "SELECT field, field2 FROM table;";
$result $dbc->query($pyt ,__FILE____LINE__);
while (
$record $result->fetch_array())
{
    echo 
$record['field'];
    echo 
$record['field2'];
}

#using numr_rows()method
echo $result->num_rows();


#using query_bool method
if($dbc->query_bool("SELECT field, field2 FROM table;"__FILE____LINE__))
{
 
//CODE
}

#using first_cell method
echo $result->first_cell();


#changinh database
$dbc->change_base('database2'__FILE____LINE__);


?>