» a PHP class to Create, Read, Update, & Delete from a mysql database table using AJAXby loud canvas media
AjaxCRUD Class Documentation / Reference Material
<< Reference overview
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.
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