extranet/www/graphs/phpdemo/dbdemo_test.php
Michael RICOIS 893f4da173 Ajout de tous les fichiers de l'extranet
Modification de certains chemins
Ajout du framework dans l'extranet
2009-02-17 13:14:53 +00:00

35 lines
845 B
PHP

<?php
#
#Create an samoke SQL statement to test the database
#
$SQLstatement = "Select Software, Hardware, Services From revenue Where Year(TimeStamp)=2001 Order By TimeStamp";
#
#Connect to the database and execute the SQL statement
#
do {
if (!($status = mysql_connect("localhost", "test", "test"))) break;
if (!($status = mysql_select_db("sample"))) break;
if (!($status = mysql_query($SQLstatement))) break;
} while (0);
if (!$status) {
print "<br><br><h2>Error accessing sample database</h2>";
if (mysql_errno()) print "Error code = ".mysql_errno()." : ".mysql_error()."<br><br>";
exit();
}
#
#Read in the revenue data into arrays
#
while ($row = mysql_fetch_row($status)) {
$software[] = $row[0];
$hardware[] = $row[1];
$services[] = $row[2];
}
?>
<html>
<body>
<p><b>Database connection test successful</b></p>
</body>
</html>