mirror of
https://codeberg.org/vlw/php-mysql.git
synced 2025-09-13 16:23:42 +02:00
feat(doc): add mysqli_results ref. to README
This commit is contained in:
parent
f31d396c00
commit
b2cd977f7e
1 changed files with 5 additions and 4 deletions
|
@ -58,6 +58,8 @@ use libmysqldriver\MySQL;
|
|||
$db = new MySQL($host, $user, $pass, $db);
|
||||
```
|
||||
|
||||
All executor methods [`select()`](#select), [`update()`](#update), and [`insert()`](#insert) will return a [`mysqli_result`](https://www.php.net/manual/en/class.mysqli-result.php) object.
|
||||
|
||||
# SELECT
|
||||
|
||||
Use `MySQL->select()` to retrieve columns from a database table.
|
||||
|
@ -67,8 +69,7 @@ Pass an associative array of strings, CSV string, or null to this method to filt
|
|||
```php
|
||||
$db->select(
|
||||
array|string|null $columns
|
||||
): array|bool;
|
||||
// Returns array of arrays for each row, or bool if no columns were defined
|
||||
): mysqli_result;
|
||||
```
|
||||
|
||||
In most cases you probably want to select with a constraint. Chain the [`where()`](#where) method before `select()` to filter the query
|
||||
|
@ -118,7 +119,7 @@ Use `MySQL->insert()` to append a new row to a database table
|
|||
$db->insert(
|
||||
// Array of values to INSERT
|
||||
array $values
|
||||
): bool
|
||||
): mysqli_result
|
||||
// Returns true if row was inserted
|
||||
```
|
||||
|
||||
|
@ -145,7 +146,7 @@ Modify existing rows with `MySQL->update()`
|
|||
$db->get(
|
||||
// Key, value array of column names and values to update
|
||||
array $fields,
|
||||
): bool;
|
||||
): mysqli_result;
|
||||
// Returns true if at least 1 row was changed
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue