PHP Classes

File: Usage

Recommend this page to a friend!
  Classes of Sandeep Kumar   Database handling   Usage   Download  
File: Usage
Role: Example script
Content type: text/plain
Description: How to use it
Class: Database handling
Execute MySQL queries using parameter lists
Author: By
Last change: Add a one more config variable and a object initialization code.
Date: 14 years ago
Size: 761 bytes
 

Contents

Class file image Download
<?php
@define('HOST','localhost');
@
define('USER','root'); // Database Access User Name
@define('PASSWORD',''); // Database Access Password
@define('DATABASE','poll'); // Database Name

@define('PREFIX',''); // Table prefix


include_once('dbclass.php');
include_once(
'dbfiler.php');
$DB =new DBFilter(); // Create an object of Dbfilter.

//suppose you want to add record in 'employee table'.
// see how it is simple
// here 'emp_name' is field in your 'employee' table.
if($_POST['add_emp'])
{
global
$DB;
$DB->InsertRecord('employee',$_POST);
}
?>
<form name="frmlist" enctype="multipart/form-data">
Enter Employee Name: <input type="text" name="emp_name" id="emp_name">
<input type="submit" name="add_emp" id="add_emp">
</form>