Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions DOC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# BasicDb
BasicDb, easy database tool based on PDO
## All
Get all data
```php
$db = basicdb(...);
$db->from("table_name")->all()
```
```php

Array
(
[0] => stdClass Object
(
...
)

[1] => stdClass Object
(
...
)
...

)
```
## First
Get all data
```php
$db = basicdb(...);
$db->from("table_name")->first()
```
```php

Array
(
[variable] => value
...
)
```
2 changes: 1 addition & 1 deletion src/BasicDB.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function all()
{
try {
$query = $this->generateQuery();
$result = $query->fetchAll(parent::FETCH_ASSOC);
$result = $query->fetchAll(parent::FETCH_OBJ);
return $result;
} catch (PDOException $e) {
$this->showError($e);
Expand Down