update | Back | Forward | Home |
'Language Reference' User Functions Database Functions Data Manipulation Functions Table Functions Error Handling Functions |
This function will update a row that matches the $where clause with the new information given in the $values, and returns the number of rows updated. The $values must be an array in the following format array([$column => $value]...) where $column is the name of the column that txtSQL will insert into, and $value is the value for that corressponding column. If the column does not exist, txtSQL will issue an error. If a $limit is defined, then txtSQL will stop updating rows and return the number of rows updated at the $limit. NOTE- This limit only needs one value (i.e. array(20) stops at 21 rows) unlike a regular limit clause. If a column is of type enum and the value being updated does not exist as one of the enum values, the last value from the enum list is inserted. Important- To achieve the same results as this function before txtSQL 2.2.2 RC2, use the execute() function Note- For more information on defining a where clause, see the how to create a where clause section Note- If the value does not match the data type (i.e. a string being updated in an integer column), txtSQL will automatically format the value Note- If a column is set to permanent, you will not be able to change this value Note- If no $db is specified and no database is already selected, txtSQL will issue an error
|