» a PHP class to Create, Read, Update, & Delete from a mysql database table using AJAXby loud canvas media
- Displaying Images
- Creating a Relationship
- File Uploading
- Using a Where Clause
- Defining Allowable Input
- Formatting a Field With a Function
- Vertical Display
- Show Header Checkbox
- Modify Field with Class
ajaxCRUDTM is an open-source PHP class which allows you to connect to a mySQL database table and easily
perform the necessary CRUD operations (create, read, update, & delete rows).
Use this tool to view data in your table, add rows. edit content, and delete rows at the click of a button (and no page reloading due to ajax).
Ever needed to provide easy "admin" access to a database table, but don't have the time/budget to code all the necessary actions you need (inserts, updates, deletes, etc...)? This PHP class allows you (and/or your clients) to get direct access to your data with a few lines of code. Short story: save time!
(try Adding, Editing (clicking on the field), or Deleting a record)
|Storthe Saving...||Storthe8585 Saving...||Credit Card Saving...||ESBRnTpFbABciP Saving...||ZqKJJ Saving...|
|Storthe Saving...||Storthe Saving...||-- Saving...||hKAdHwIx Saving...||pLULM Saving...|
|Storthe Saving...||Storthe Saving...||Credit Card Saving...||BwjKjHaLdyHrEEM Saving...||puExu Saving...|
|Storthe Saving...||Storthe Saving...||Credit Card Saving...||tFIJwfQiGHXEvfb Saving...||jdoFZ Saving...|
|Marcelo Saving...||Narvaez Saving...||Cash Saving...||(593) 123-1234 Saving...||-- Saving...|
|John Saving...||Jingleheimerschmidt Saving...||Cash Saving...||(916) 555-5555 Saving...||95814 Saving...|
|Storthe Saving...||Storthe Saving...||Paypal Saving...||PjjLwUBKUzfv Saving...||FYLCm Saving...|
Hundreds of other styles available at http://icant.co.uk/csstablegallery
Just a few lines of code:
# include this file at the very top of your script require_once('preheader.php'); # the code for the class include ('ajaxCRUD.class.php'); # this one line of code is how you implement the class $tblCustomer = new ajaxCRUD("Customer", "tblCustomer", "pkCustomerID"); # don't show the primary key in the table $tblCustomer->omitPrimaryKey(); # my db fields all have prefixes; # display headers as reasonable titles $tblCustomer->displayAs("fldFName", "First"); $tblCustomer->displayAs("fldLName", "Last"); $tblCustomer->displayAs("fldPaysBy", "Pays By"); $tblCustomer->displayAs("fldPhone", "Phone"); $tblCustomer->displayAs("fldZip", "Zip"); # define allowable fields for my dropdown fields # (this can also be done for a pk/fk relationship) $values = array("Cash", "Credit Card", "Paypal"); $tblCustomer->defineAllowableValues("fldPaysBy", $values); # add the filter box (above the table) $tblCustomer->addAjaxFilterBox("fldFName"); # add validation to certain fields (via jquery in validation.js) $tblCustomer->modifyFieldWithClass("fldPhone", "phone"); $tblCustomer->modifyFieldWithClass("fldZip", "zip"); # actually show to the table $tblCustomer->showTable();
DB Table for Demo Above
Here is the table used:
CREATE TABLE tblCustomer( pkCustomerID INT PRIMARY KEY AUTO_INCREMENT, fldFName VARCHAR(40), fldLName VARCHAR(40), fldPaysBy VARCHAR(20), fldPhone VARCHAR(15), fldZip VARCHAR(5), );
(View Demo outside template)
Is it light? Flexible?
4 files! Installs in seconds. The CSS, field validation, and table display is completely customizable.
Ok, I'm sold. Let me try it out!