Login   Register  
PHP Classes
elePHPant
Icontem

File: example

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Daniel Vasic  >  Simple DBase  >  example  >  Download  
File: example
Role: Example script
Content type: text/plain
Description: example file
Class: Simple DBase
Simple MySQL database access wrapper
Author: By
Last change:
Date: 3 years ago
Size: 559 bytes
 

Contents

Class file image Download
<?php 
define
('HOST''localhost');
define('USER''root');
define('PASS''');
define('TABLE''cms');

include(
"db_class.inc.php");
$db = new db (HOSTUSERPASSTABLE);
/*Count rows*/
    
$db->sqlQuery("SELECT null FROM comments");
    
$string printf("You have "$db->numRows() . " fields in this table<br />");
    
$db->clearQuery();

/*Fetch data*/
    
$db->sqlQuery("SELECT id, email FROM comments");
    while(
$row $db->fetchData()){
        
printf("id : %s\temail : %s<br />",$row['id'], $row['email']);
    }
    
$db->clearQuery();
$db->close();

?>