» 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


sets a value to a field on row insert
void addValueOnInsert( String fieldName, String value )
This function should be used when certain fields should be immediately populated with pre-defined data. A good use of this function is when your table has a "date created" field for an entity. This field can be automatically determined (by mySQL) and then set when adding the row.

Keep in mind: this function will overwrite any value input by the user for this field. Therefore it should always be used in conjuctiton with omitAddField so that an input box for the field does not even display when adding an entry.


Type function
Returns void


The database field name you want to be able to assign a specific data input to on row insert
Value to overwrite the field with - if the value is "NOW()" it is parsed not as a string, but as a mySQL expression


$tblDemo->addValueOnInsert("fldCreationDate", "NOW()");

NOTE: you MUST use omitAddField with the field for it to be overwritten; reason being - if a value is sent for that field as part of the "add" form then that takes priority over addValueOnInsert

See also

New, Edit


"Great api. Really love the demo. "

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.