ajaxCRUD.com

» 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

doActionOnShowTable

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

Details

Type variable
Default value true

Example

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

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

  $obj->onAddExecuteCallBackFunction("onAddCallBackFunction");

  // 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'] != ''){
     $obj->doAction($_REQUEST['action']);
  }

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

  //set cookie 10 years in the future
  setcookie(
    "ajaxCRUDEventID_$newID",
    "cookieset",
    time() + (10 * 365 * 24 * 60 * 60)
  );
  //print_r($_COOKIE);
}

See also

New, Edit

 

"Very interesting class. Thanks a lot."
~gustavo

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