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

onUpdateExecuteCallBackFunction

calls a local, user-defined php function after a particular field is edited/updated
void onUpdateExecuteCallBackFunction ( String fieldName, String functionName )

Use this function when you want to apply certain logic (or display a certain message) when a row is updated/edited. Use of this function is similar in a way to a java interface: you must define a function with the name specified in the function call.

The defined function must take ONE parameter (an array). The indexes of this array are the fields values of the entire edited row.

NOTE: this function will TURN OFF ajax editing (for that particular field)

Details

Requires (callback function)
Type function
Returns void

Parameters

fieldName
name of the field which, after edited, will cause the callback function to be executed
functionName
name of the local, user-defined function to be invoked when the field is updated/edited

Example

$demo->onUpdateExecuteCallBackFunction("fldBirthday", 
      "doMyLogicAfterUpdating");

//down below the showTable() function
function doMyLogicForUpdating($array){
  $pkBirthdayID = $array['pkBirthdayID']; //example index - field in db
  $fldName = $array['fldName']; //example index - field in db
  $fldBirthday = $array['fldBirthday']; //example index - field in db
  $age = calulateAge($fldBirthday, $fldName) //example function-not shown

  //update this table (or some other table)
  if ($fldURL == ''){
    $success = qr("UPDATE tblPerson SET fldAge = \"$age\"
                              WHERE pkPersonID = 3");
  }
}

See also

New, Edit

 

"wow. that`s all I can say. Wow. I wish I had found this .... years ago.."
~Jake

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