<?php
require_once('class.php');
#connecting to mysql server
$dbc = new dbconnect('localhost', 'root', 'password', 'database', __FILE__, __LINE__);
#using imple query and fetch_array method
$query = "SELECT field, field2 FROM table;";
$result = $dbc->query($pyt ,__FILE__, __LINE__);
while ($record = $result->fetch_array())
{
echo $record['field'];
echo $record['field2'];
}
#using numr_rows()method
echo $result->num_rows();
#using query_bool method
if($dbc->query_bool("SELECT field, field2 FROM table;", __FILE__, __LINE__))
{
//CODE
}
#using first_cell method
echo $result->first_cell();
#changinh database
$dbc->change_base('database2', __FILE__, __LINE__);
?>
|