<!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>
 
 |