PHP Classes

File: test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Ray  >  IdealMySQL Class  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Example file
Class: IdealMySQL Class
MySQL database access wrapper
Author: By
Last change:
Date: 8 years ago
Size: 820 bytes


Class file image Download
        <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','','This stuff')");

// Selet some information from the database
$stuff = $dbtest->MySQLQuery("SELECT * FROM database");
$row = mysql_fetch_array($stuff)) {