<?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";
?>
|