What is ajaxCRUDTM?

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

Why use ajaxCRUD?

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 it!

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


First:
FirstLastPays ByPhoneZipAction
-- -- Cash -- --
') AND JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
')) AND JSON_KEYS((SELECT CONVERT((SELEC --  --  -- --
'))) AND JSON_KEYS((SELECT CONVERT((SELE --  --  -- --
' AND JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
') AND JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
')) AND JSON_KEYS((SELECT CONVERT((SELEC --  --  -- --
'))) AND JSON_KEYS((SELECT CONVERT((SELE --  --  -- --
%' AND JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
' AND JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
AND JSON_KEYS((SELECT CONVERT((SELECT C --  --  -- --
AND JSON_KEYS((SELECT CONVERT((SELECT C --  --  -- --
') WHERE 2636=2636 AND JSON_KEYS((SELECT --  --  -- --
) WHERE 8434=8434 AND JSON_KEYS((SELECT --  --  -- --
' WHERE 9860=9860 AND JSON_KEYS((SELECT --  --  -- --
WHERE 9975=9975 AND JSON_KEYS((SELECT C --  --  -- --
'||(SELECT 0x78526f72 WHERE 4003=4003 AN --  --  -- --
'||(SELECT 0x526b6e66 FROM DUAL WHERE 84 --  --  -- --
'+(SELECT 0x77534d6a WHERE 1315=1315 AND --  --  -- --
||(SELECT 0x595a6b4e FROM DUAL WHERE 167 --  --  -- --
||(SELECT 0x73434249 WHERE 5785=5785 AND --  --  -- --
+(SELECT fKeC WHERE 6526=6526 AND JSON_K --  --  -- --
+(SELECT 0x4d6d614a WHERE 9575=9575 AND -- Credit Card -- --
dsf --  --  -- --
') AS wLSS WHERE 5712=5712 AND JSON_KEYS --  --  -- --
) AS Izlp WHERE 9457=9457 AND JSON_KEYS( --  --  -- --
` WHERE 4750=4750 AND JSON_KEYS((SELECT --  --  -- --
`) WHERE 4015=4015 AND JSON_KEYS((SELECT --  --  -- --
`=`` AND JSON_KEYS((SELECT CONVERT((SELE --  --  -- --
]-(SELECT 0 WHERE 4547=4547 AND JSON_KEY --  --  -- --
) OR JSON_KEYS((SELECT CONVERT((SELECT C --  --  -- --
') OR JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
' OR JSON_KEYS((SELECT CONVERT((SELECT C --  --  -- --
) OR JSON_KEYS((SELECT CONVERT((SELECT C --  --  -- --
)) OR JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
))) OR JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
OR JSON_KEYS((SELECT CONVERT((SELECT CO --  --  -- --
') OR JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
')) OR JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
'))) OR JSON_KEYS((SELECT CONVERT((SELEC --  --  -- --
' OR JSON_KEYS((SELECT CONVERT((SELECT C --  --  -- --
') OR JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
')) OR JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
edrtt ertertewrter Credit Card (545) 646-4646 --
%' OR JSON_KEYS((SELECT CONVERT((SELECT --  --  -- --
' OR JSON_KEYS((SELECT CONVERT((SELECT C --  --  -- --
OR JSON_KEYS((SELECT CONVERT((SELECT CO --  --  -- --
OR JSON_KEYS((SELECT CONVERT((SELECT CO --  --  -- --
' OR JSON_KEYS((SELECT CONVERT((SELECT C --  --  -- --
') WHERE 8072=8072 OR JSON_KEYS((SELECT --  --  -- --

1 2 3      >> >>|




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


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),
    );

Is it light? Flexible?

4 files! Installs in seconds. The CSS, field validation, and table display is completely customizable.