From a614003033f63f2d095224aaf5571b1374e64a5c Mon Sep 17 00:00:00 2001 From: vlw Date: Wed, 25 Sep 2024 13:21:36 +0000 Subject: [PATCH] fix: remove reference to removed method `flatten()` from README --- README.md | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/README.md b/README.md index 60fc1b7..1345d10 100644 --- a/README.md +++ b/README.md @@ -108,24 +108,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 Chain `MySQL->insert()` anywhere after a [`MySQL->for()`](#for) to append a new row to a database table. @@ -330,9 +312,6 @@ MySQL->limit( ): 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 This will simply `LIMIT` the results returned to the integer passed