UpdateQuery Class
Create a new update query
$updated = $db->update('users')
->set('first_name', 'Smith')
->where('user_id=1')
->result();
Constructor
Item Index
Methods
__toString
()
String
Represent the query as a SQL statement
Returns:
String:
The query in SQL string form
limit
(
Query
-
lengthOrIndex
-
[duration=null]
The limit for query
Parameters:
-
lengthOrIndex
IntEither the single limit number or index, duration
-
[duration=null]
Int optionalHow many rows to fetch
Returns:
Query:
The instance of this query
orderBy
(
Query
-
field
-
[order='asc']
How to order the results by
Parameters:
Returns:
Query:
The instance of this query
prepare
(
String
protected
-
value
Take an existing value we're about to input and escape it, if needed
Parameters:
-
value
StringA statement or sql property to evaluate
Returns:
String:
A string of an escaped, prepared SQL property
prepareField
(
String
protected
-
field
Take an existing field name we're about to input and
Parameters:
-
field
StringThe name of a field
Returns:
String:
A string of an escaped, prepared SQL field name
set
(
UpdateQuery
-
name
-
[value=null]
Set a value or series of values
Parameters:
Returns:
UpdateQuery:
Return instance of this query