ajaxCRUD.com

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

   by loud canvas media

Quick Links:

Quick Examples:


What is ajaxCRUD?

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).

Please explain...

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!

"Customers" Example:

(try Adding, Editing (clicking on the field), or Deleting a record)


First:
FirstLastPays ByPhoneZipAction
huh wow Cash (123) 123-1234 12345
Mark Mark Credit Card 95840746862 46835
Mark Mark Cash 27121841092 69365
Mark Mark Credit Card 17199741838 94469
Mario erty Paypal (456) 346-3456 98769
Mark Mark Credit Card 92798082509 82358
Mark Mark Credit Card 77145649784 56088
Mark Mark Credit Card 83228890766 14756
Mark Mark Cash 28912180668 93574
Mark Mark Credit Card 86029403874 43839
Mark Mark Credit Card 46409221201 27795
Mark Mark Credit Card 94287597443 82442
Mark Mark Credit Card 93511149880 75898
Mark Mark Credit Card 53168034526 68279
Mark Mark Credit Card 10192029634 58729
Mark Mark Credit Card 66869887849 96854
Mark Mark Credit Card 48635544751 26966
Mark Mark Paypal 75386156250 42312
Mark Mark Credit Card 49036653855 15800
Mark Mark Credit Card 11938513038 25274
Mark Mark Credit Card 75022820886 49991
Mark Mark Credit Card 72533938412 76207
Mark Mark Credit Card 80416413494 57724
Mark Mark Credit Card 59522766863 48445
Mark Mark Credit Card 71990709137 20248
Mark Mark Credit Card 33339790381 13043
Mark Mark Credit Card (123) 456-4566 69501
Mark Mark Credit Card 70707387225 92199
Mark Mark Credit Card 29192340937 19447
Mark Mark Credit Card 67576244659 93765
Mark Mark Credit Card 35825313855 53523
Mark Mark0 Credit Card 47826465495 98469
Mark Mark Credit Card 54161299007 43311
Mark Mark Credit Card 34944289663 57511
Mark Mark Credit Card 77997028181 74770
Mark Mark Credit Card 97532119384 59027
Mark Mark Credit Card 14113411406 51960
Mark Mark Credit Card 20439947608 26246
Mark Mark Credit Card 72570024065 85386
Mark Mark Credit Card 21776789294 61486
Mark Mark Cash 70825821791 74422
Mark Mark Paypal 37812218387 53248
Mark Mark Credit Card 70956742801 26296
Mark Mark Credit Card 73182928600 67802
Mark Mark Credit Card 65248813689 55634
Mark Mark Credit Card 99919080903 86264
Ali ismail Korkmaz Credit Card (566) 666-6666 98989
Mark Mark Credit Card 58238275072 31495
Mark Mark Credit Card 67426789480 91828
Mark Mark Credit Card 59287387245 99622

1 2 3      >> >>|




Please do not post web-links (urls) of any kind or you will be banned.


Hundreds of other styles available at http://icant.co.uk/csstablegallery

Okay, how did you do that!?

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!

» Download the code now
» View the Reference Material (Class Documentation)
» View Framework on Github
» View Demo outside template


Need a place to host your web application? At Loud Canvas Media we provide website design and hosting solutions in/around Dover NH.

 

"I just wanted to take the time to say I have been looking for an ajax table for months, I probably could have built one by now. Ive seen and Ive tried many different ajax tables and I have to say this ones by far the "BEST" out there! Thank you so much Loud Canvas Media. for all of your hard work. AWESOME! AWESOME! 5 stars."
~jeramy1978

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.
Close