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

   by loud canvas media

AjaxCRUD Class Documentation / Reference Material

<< Reference overview
<< Home


when set to true CRUD actions will happen when showTable() is called
CRUD operations will happen (by default) when the showTable() function is called; however, this may not always be desired -- for example when executing callback functions like onAddExecuteCallBackFunction which might require headers not to bet set. Set this to FALSE if you want to have more control over the execution path


Type variable
Default value true


  $obj = new ajaxCRUD("Me", "tblEventAttendee",
                                      "pkAttendeeID", "../ajaxcrud/");

  //ensures headers won't be set first
  $obj->doActionOnShowTable = false; 


  // this needs to be very low in the excution path to 
  // ensure the obj is loaded correctly with every other piece of logic
  if (isset($_REQUEST['action']) && $_REQUEST['action'] != ''){

function onAddCallBackFunction($array){
  global $idsAdded;
  $newID = $array['pkAttendeeID'];
  $idsAdded[] = $newID; //array push

  //set cookie 10 years in the future
    time() + (10 * 365 * 24 * 60 * 60)

See also

New, Edit


"ajaxCRUD is wonderful."
~Peter Barone

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.