mirror of
https://codeberg.org/vlw/php-mysql.git
synced 2025-09-14 00:33:41 +02:00
feat(doc): add string doc for select to README
This commit is contained in:
parent
db26e36ac3
commit
ff77faee75
1 changed files with 5 additions and 4 deletions
|
@ -59,13 +59,13 @@ $db = new MySQL($host, $user, $pass, $db);
|
|||
|
||||
# SELECT
|
||||
|
||||
Use `MySQL->select()` to retrieve columns from a database table
|
||||
Use `MySQL->select()` to retrieve columns from a database table.
|
||||
|
||||
Pass an associative array of strings, CSV string, or null to this method to filter columns.
|
||||
|
||||
```php
|
||||
$db->select(
|
||||
// Sequential array of string with column names to retrieve
|
||||
// Or null to retrieve a bool if rows were matched
|
||||
?array $columns
|
||||
array|string|null $columns
|
||||
): array|bool;
|
||||
// Returns array of arrays for each row, or bool if no columns were defined
|
||||
```
|
||||
|
@ -75,6 +75,7 @@ In most cases you probably want to select with a constraint. Chain the [`where()
|
|||
### Example
|
||||
```php
|
||||
$beverages = $db->for("beverages")->select(["beverage_name", "beverage_size"]); // SELECT beverage_name, beverage_size FROM beverages
|
||||
$beverages = $db->for("beverages")->select("beverage_name, beverage_size"); // SELECT beverage_name, beverage_size FROM beverages
|
||||
```
|
||||
```
|
||||
[
|
||||
|
|
Loading…
Add table
Reference in a new issue