Returns the number of affected rows on success, and -1 if the last query failed. If the last query was a DELETE query with no WHERE clause, all of the records will have been deleted from the table but this function will return zero with MySQL versions prior to 4.1. 2.
Updating a field in a given table requires two steps:
1) Changing the value of the field to be updated
2) Applying the UPDATE statement against the current value of the field.
Here is an SQL update query example:
UPDATE "table1" SET "key_field" = "New Value" WHERE "id = ?";
This SQL update query changes the value of an existing key field to New Value and updates all rows where that key matches with that of the input.
The update queries workload for low-level and high-level queries has been reduced making them more efficient.
QL can be used with limits to create more complex queries.
The SQL statement LIMIT 20, 10 is the same as SELECT * FROM users WHERE users.id = 20
LIMIT 10, 20 is the same as SELECT * FROM users WHERE users.id BETWEEN 10 AND 20
LIMIT 50, 100 is the same as SELECT * FROM users AS u1 WHERE u1.id BETWEEN 50 AND 100
LIMIT 1, 2 is the same as SELECT * FROM users AS u2 WHERE u2.id<> 1