mirror of
https://codeberg.org/vlw/php-mysql.git
synced 2025-09-14 00:33:41 +02:00
feat(doc): add DELETE executor ref to README
This commit is contained in:
parent
50ff083c5f
commit
cf0ea0836f
1 changed files with 30 additions and 1 deletions
31
README.md
31
README.md
|
@ -37,6 +37,7 @@ Statement|Method
|
||||||
`SELECT`|[`select()`](#select)
|
`SELECT`|[`select()`](#select)
|
||||||
`UPDATE`|[`update()`](#update)
|
`UPDATE`|[`update()`](#update)
|
||||||
`INSERT`|[`insert()`](#insert)
|
`INSERT`|[`insert()`](#insert)
|
||||||
|
`DELETE`|[`delete()`](#delete)
|
||||||
`WHERE`|[`where()`](#where)
|
`WHERE`|[`where()`](#where)
|
||||||
`ORDER BY`|[`order()`](#order-by)
|
`ORDER BY`|[`order()`](#order-by)
|
||||||
`LIMIT`|[`limit()`](#limit)
|
`LIMIT`|[`limit()`](#limit)
|
||||||
|
@ -139,6 +140,34 @@ MySQL->for("beverages")->insert([
|
||||||
true
|
true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# DELETE
|
||||||
|
|
||||||
|
Use `MySQL->delete()` to remove a row or rows from the a database table.
|
||||||
|
|
||||||
|
```php
|
||||||
|
MySQL->delete(
|
||||||
|
array ...$conditions
|
||||||
|
): mysqli_result|bool
|
||||||
|
// Returns true if at least one row was deleted
|
||||||
|
```
|
||||||
|
|
||||||
|
This method takes at least one [`MySQL->where()`](#where)-syntaxed argument to determine which row or rows to delete. Refer to the [`MySQL->where()`](#where) section for more information.
|
||||||
|
|
||||||
|
#### Example
|
||||||
|
|
||||||
|
```php
|
||||||
|
MySQL->for("beverages")->insert([
|
||||||
|
null,
|
||||||
|
"coffee",
|
||||||
|
"latte",
|
||||||
|
10
|
||||||
|
]);
|
||||||
|
// INSERT INTO beverages VALUES (null, "coffee", "latte", 10);
|
||||||
|
```
|
||||||
|
```
|
||||||
|
true
|
||||||
|
```
|
||||||
|
|
||||||
# UPDATE
|
# UPDATE
|
||||||
|
|
||||||
Modify existing rows with `MySQL->update()`
|
Modify existing rows with `MySQL->update()`
|
||||||
|
@ -164,7 +193,7 @@ In most cases you probably want to UPDATE against a constaint. Chain a [`where()
|
||||||
|
|
||||||
# WHERE
|
# WHERE
|
||||||
|
|
||||||
Filter a `select()` or `update()` method by chaining the `MySQL->where()` method anywhere before it.
|
Filter a `select()` or `update()` method by chaining the `MySQL->where()` method anywhere before it. The `MySQL->delete()` executor method also uses the same syntax for its arguments.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
MySQL->where(
|
MySQL->where(
|
||||||
|
|
Loading…
Add table
Reference in a new issue