<?php
include("DBClass.php");
//To config. databse information
$con=new Database("localhost","database","username","password");
//To Connect the database
$con->connect();
// Assume BTable is Two column table [ Authour and Book ]
// To get the rows from BTable
// $rows - is a associate array
$rows = $con->getRows("Select * from BTable");
//To Connection Closed
$con->close();
// To Display the data
foreach ($rows as $row)
{
echo $row["Author"];
echo $row["Book"];
}
//To Connect the database
$con->connect();
//To inserted the data(s) into the table
$con->putRows("insert into BTable values('Name','Title')");
//To Connection Closed
$con->close();
?>
|