ajaxCRUD.com

» a PHP class to create / read / update / delete from a database table using AJAX

   by loud canvas media

AjaxCRUD API Reference

<< Reference overview
<< Home

ajaxCRUD

constructor for instantiating the class
(String buttonText, String dbTableName, String dbPrimaryKey)
This constuctor is used to instantiate the PHP object. You must pass in the three required values and this will create your ajaxCRUD object!

ButtonText:
Type: String.
Purpose: Button Text. This value is just a descriptive string that will show up on the ADD button and on the input form when the user is adding a new record.

dbTableName:
Type: String.
Purpose: Table name. This is the name of the table that you want to display.

pkPrimaryKey
Type: String.
Purpose: Identifies the field that you want to use as the primary key of the table. This is also the field that will be used by the omitPrimaryKey() function. This field does not have to be defined in the table as a primary key, but ajaxCRUD will not work as expected if the values in this field are not unique.

Details

Type constructor
Returns object

Example

$tblDemo = new ajaxCRUD("Apple", "tblApples", "pkAppleID");

Example2: ajaxCRUD("ITEM", "TableName", "pkItemID") will yield an ADD button that says "Add ITEM"
Example3: ajaxCRUD("PERSON", "TableName", "pkPersonID") will yield an ADD button that says "Add PERSON"

See also

New, Edit

 

"Brilliant. Saved insane amounts of time. `nuff said."
~Soule