<?php
require_once('./MySQLWrapper/QueryManager.php');
$qm = QueryManager::getInstance();
$columnValueArray = array('email'=>array('root@localhost'));
$qm->countRowsInTable("user", $columnValueArray, true, "or", "and");
echo "<br /><br />";
$qm->executeMyQuery("Select * from user");
echo "<br /><br />";
$qm->selectAllFromTable("user", "username='gurdeep'");
echo "<br /><br />";
$columnArray = "username, email, enabled";
$condition = "username like '%gurdeep%'";
$qm->selectColumnValueFromTable("user", $columnArray, $condition);
echo "<br /><br />";
$tableArray = array('id'=>array(int, 'Not Null', 'Auto_increment', 'primary key'), 'username'=>array('varchar(255)', 'Not Null'), 'password'=>array('varchar(255)', 'Not null'), 'FirstName'=>array('varchar(255)'), 'lastName'=>array('varchar(255)'));
$qm->createTable("user", $tableArray);
echo "<br /><br />";
echo $encPassword = md5('gurdeep');
$valueArray = array('username'=>'gurdeep', 'password'=>$encPassword, 'FirstName'=>'Gurdeep', 'LastName'=>'Singh');
$qm->insertIntoTable("user", $valueArray);
echo "<br /><br />";
$valueArray = array('username'=>'harleen', 'password'=>md5('gurdeep'));
$qm->updateTable("user", $valueArray, "id=1");
echo "<br /><br />";
$qm->deleteFromTable("user", "id=2", false);
?>
|