<html>
<head>
<title>Test IdealMySQL Class</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
// Include the IdealMySQL Class
include ("./IdealMySQL.class.php");
// Create a new object
$dbtest = new IdealMySQL("database","localhost","dbuser","dbpassword");
// Check variable to make sure it does not have any invalid characters
// the only valid characters are: a-zA-Z0-9_-
$dbtest->checkvar("a$");
// Insert some information into the database.
$dbtest->MySQLQuery("INSERT INTO database(name,email,text) VALUES('name','email@email.com','This stuff')");
// Selet some information from the database
$stuff = $dbtest->MySQLQuery("SELECT * FROM database");
while($row = mysql_fetch_array($stuff)) {
echo $row['id']."<br>";
}
?>
</body>
</html>
|