» a PHP class to Create, Read, Update, & Delete from a mysql database table using AJAX

   by loud canvas media

Quick Links:

Quick Examples:

Show Checkbox - All

Consider the following table:

fldField1 VARCHAR(45),
fldField2 VARCHAR(45),
fldCertainFields VARCHAR(40),
fldLongField TEXT

CRUD abcd
Allowable Value 1 CARACA
CRUD aaaa

Class Implementation:

#required file and class
require_once ('preheader.php');
include_once ('ajaxCRUD.class.php')

#this one line of code is how you implement the class
$tblDemo = new ajaxCRUD("Item", "tblDemo", "pkID");


#define our checkboxes

#show header checkboxes
$tblDemo->showCheckboxAll('fldField1', true);
$tblDemo->showCheckboxAll('fldField2', true);

#for heck of it, only certain fields are allowed for fldCertainFields
$allowableValues = array("Allowable Value 1", "Allowable Value2",
                                             "Dropdown Value", "CRUD");
$tblDemo->defineAllowableValues("fldCertainFields", $allowableValues);

#disallow adding and deleting rows

#actually show the table

Read API Documentation on this function here.

View Example by Itself

Click here to view example outside of the template.


"Thanks a bunch for this class. Man, it really does make turning around a CRUD quickly with cool fade effects for managers. Thanks for making this."

What is a business/commercial website?

A commercial website is one created for a business, for which purpose is generating revenue or cash flow of any type (and that isn't under a non-profit organization). So if you're selling a product, selling advertisement, selling a service, or just marketing a commercial business, your site is commercial. A company website is also commercial even if it doesn't sell anything, as it's purpose is to front a commercial company.