Location: PHPKode > scripts > IdealMySQL Class > idealmysql-class/test.php
		<title>Test IdealMySQL Class</title>
	<link href="style.css" rel="stylesheet" type="text/css" />
// 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_- 

// Insert some information into the database.
$dbtest->MySQLQuery("INSERT INTO database(name,email,text) VALUES('name','hide@address.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>";
Return current item: IdealMySQL Class