PHP Classes

File: dbMysqli/test.php

Recommend this page to a friend!
  Classes of Kemal GENIS   DB Classes   dbMysqli/test.php   Download  
File: dbMysqli/test.php
Role: Example script
Content type: text/plain
Description: Example script
Class: DB Classes
Access different types of databases
Author: By
Last change: .update
Date: 5 years ago
Size: 1,010 bytes
 

Contents

Class file image Download
<?php
header
('Content-Type: text/html; charset=utf-8');
include_once
"dbMysqli.class.php";

# CONNECTION & SETTINGS
$db = new dbMysqli('db_server', 'db_user', 'db_pass', 'db_name');
$db->setDebug(true);

# SELECT fetchArray
echo "<h4>SELECT fetchArray TEST</h4>";
$sqlSelect = "SELECT * FROM pages";
$rowSelect = $db->fetchArray($sqlSelect);
$rowSelect = $db->fetchArray('select * from pages_trans');
$rowSelect = $db->fetchArray($sqlSelect);
echo
"<pre>".var_export($rowSelect, true);

# SELECT fetchObject
echo "<h4>SELECT fetchObject TEST</h4>";
$sqlSelect = "SELECT * FROM pages";
$rowSelect = $db->fetchObject($sqlSelect);
echo
"<pre>".var_export($rowSelect, true);

# NUM ROWS
echo "<h4>NUM ROWS TEST</h4>";
$sqlSelect = "SELECT * FROM pages";
$rowSelect = $db->numRows($sqlSelect);
echo
"<pre>".var_export($rowSelect, true);


# NUM ROWS COUNT
echo "<h4>NUM ROWS COUNT TEST</h4>";
$sqlSelect = "SELECT * FROM pages";
$rowSelect = $db->numRowsCount($sqlSelect);
echo
"<pre>".var_export($rowSelect, true);