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 V. Yanson  >  rsmysql  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: rsmysql
Measure time spent executing MySQL queries
Author: By
Last change:
Date: 2006-07-28 10:48
Size: 514 bytes
 

Contents

Class file image Download
<?php

include_once('class.mysql.php');

// database configuration
$GLOBALS['db_conf'] = array(
    
'host'    =>    'localhost',
    
'user'    =>    'root',
    
'pass'    =>    'whatever',
    
'db'    =>    'my_database',
    
'pers'    =>    false // persistent connection?
);

$db = new mysql($conf);

// execute query
$ret $db->query('select * from my_table where active=1');
print_r($ret);
echo 
'Total queries: ' $GLOBALS['total_mysql_queries'] . "\n";
echo 
'Total query execution time: ' $GLOBALS['total_mysql_time'] . "\n";

?>