PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Alexander Serbe   xMySQL   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: The example shown in the readme file.
Class: xMySQL
Simple but effective class for the work with MySQL
Author: By
Last change:
Date: 20 years ago
Size: 845 bytes
 

Contents

Class file image Download
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>xMySQL Example</title>
</head>

<body>

<?php
// Include the class files
include ( "objectstatus.class.php" );
include (
"xmysql.class.php" );

// Initialize a new objectStatus instance. This is not mandatory...
$os = new objectStatus ();

// Initialize a new xMySQL object
$db = new xMySQL ( "xmysql.host_list.php", 0, &$os );

// Execute a SELECT query
$select = "test_field_1, test_field_2";
$from = "xmysql_test";
$where = "test_id>=5";

$result = $db->xSelect ( $select, $from, $where );

echo
"<hr />";
for (
$i=0; $i<count ( $result ); $i++ )
{
   
$row = $result[$i];
    echo
$row[0] . "-" . $row[1] . "<br />";
}
echo
"<hr />";

// Display status messages...
echo $db->os->statusPrintout ();
?>

</body>
</html>