<?php
/** http://chatfren.com/ **/
/** Chatfren Live: http://chatfren.com/chat.php?u=huang_hanzen **/
/** Example **/
require 'class_sql.php';
$db = array(
'host' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'test'
);
$db = new MySQL($db);
$sql = 'SELECT * FROM `table` LIMIT 20';
$db->query($sql);
while($data = $db->fetch()){
/** loop data here **/
}
echo 'Total Rows: '.$db->rows();
$db->close();
?>
|