» 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 the field to be of type 'checkbox'.
void defineCheckbox ( String fieldName, [ String value_on], [String value_off] )
Use this function if you have an on/off or yes/no type of field (two options). As such you want a simple checkbox to toggle between the options.
The default value for checked (on) is 1 and unchecked (off) is 0. However, you can set your own values, with the two optional parameters.
//this will set 1 for checked and 0 for unchecked (perfect if your field is an INT or TINYINT)
//this will define it so that "on" is for checked and "off" is for unchecked
//(obviously you want to use a varchar or a text now)