<?
require_once "db.class.php";
// example to connect remember to replace the $MDB parameters by yours parameters
// your_ip_db_server : is the db server for mysql, postgres and odbtp database
$MDB = array ();
$MDB['type'] = '';
$MDB['host'] = 'your_ip_db_server';
$MDB['user'] = 'myuser';
$MDB['password'] = 'mypass';
$MDB['dbname'] = 'mydb';
$q = array ();
$q['mysql'] = "select now()"; //query for mysql
$q['psql'] = "select now()"; //query for psql
$q['odbtp(mssql)'] = "select getdate()"; //query for mssql over odbtp
$db = new mdb;
foreach($q as $k => $v){
$MDB['type'] = $k;
echo "{$k} : {$v} <br>";
if($db->db_dbArray($MDB, $v)){
var_dump($db->_db['data'][0]);
echo "<hr>";
}else{
echo $db->_db['debug'];
echo "<hr>";
}
}
?>
|