PHP Classes

File: mysql_dialog_test

Recommend this page to a friend!
  Classes of Giorgos   MySQL Dialog   mysql_dialog_test   Download  
File: mysql_dialog_test
Role: Example script
Content type: text/plain
Description: Testing the mysql_dialog class
Class: MySQL Dialog
Execute MySQL queries and display results in HTML
Author: By
Last change:
Date: 19 years ago
Size: 602 bytes
 

Contents

Class file image Download
<?php
include("mysql_dialog.php");
$host="localhost"; // Your MySQL Host
$user="root"; // Your MySQL User
$pass=""; // Your MySQL Password
$dbase="test"; // Name of your MySQL Database
$sql="show tables"; // SQL String to send to the Database Server

$db=new mysql_dialog("1"); // with "1" possible errors will be printed
$db->connect($host,$user,$pass,$dbase);
$db->onscreen($sql);
$db->speak($sql);
while (
$out=$db->listen()){
for (
$x=0; $x<$db->fields; $x++){
echo
$out[$x]."<br>";
}
}
echo
"Number of rows: ".$db->rows."<br>";
echo
"Number of fields: ".$db->fields."<br>";
?>