mirror of
https://codeberg.org/vlw/php-mysql.git
synced 2025-09-14 16:43:42 +02:00
fix(doc): remove reference to removed method flatten()
from README (#38)
Closes #14 Reviewed-on: https://codeberg.org/vlw/php-mysql/pulls/38 Co-authored-by: vlw <victor@vlw.se> Co-committed-by: vlw <victor@vlw.se>
This commit is contained in:
parent
1727247fa7
commit
6e37626539
1 changed files with 0 additions and 21 deletions
21
README.md
21
README.md
|
@ -107,24 +107,6 @@ $beverages = MySQL->for("beverages")->select(["beverage_name", "beverage_size"])
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Flatten array to single dimension
|
|
||||||
|
|
||||||
If you don't want an array of arrays and would instead like to access each key value pair directly. Chain the `MySQL->flatten()` anywhere before `MySQL->select()`.
|
|
||||||
This will return the key value pairs of the first entry directly.
|
|
||||||
|
|
||||||
> **Note**
|
|
||||||
> This method will not set `LIMIT 1` for you. It is recommended to chain `MySQL->limit(1)` anywhere before `MySQL->select()`. [You can read more about it here](https://github.com/VictorWesterlund/php-libmysqldriver/issues/14)
|
|
||||||
|
|
||||||
```php
|
|
||||||
$coffee = MySQL->for("beverages")->limit(1)->flatten()->select(["beverage_name", "beverage_size"]); // SELECT beverage_name, beverage_size FROM beverages WHERE beverage_type = "coffee" LIMIT 1
|
|
||||||
```
|
|
||||||
```php
|
|
||||||
[
|
|
||||||
"beverage_name" => "cappuccino",
|
|
||||||
"beverage_size" => 10
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
# INSERT
|
# INSERT
|
||||||
|
|
||||||
Chain `MySQL->insert()` anywhere after a [`MySQL->for()`](#for) to append a new row to a database table.
|
Chain `MySQL->insert()` anywhere after a [`MySQL->for()`](#for) to append a new row to a database table.
|
||||||
|
@ -329,9 +311,6 @@ MySQL->limit(
|
||||||
): self;
|
): self;
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note**
|
|
||||||
> You can also flatten to a single dimensional array from the first entity by chaining [`MySQL->flatten()`](#flatten-array-to-single-dimension)
|
|
||||||
|
|
||||||
## Passing a single integer argument
|
## Passing a single integer argument
|
||||||
This will simply `LIMIT` the results returned to the integer passed
|
This will simply `LIMIT` the results returned to the integer passed
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue