From 5fc6a385276137d8b9f2c4f931291d9723c6ad84 Mon Sep 17 00:00:00 2001 From: Kerim Date: Tue, 30 Mar 2021 15:54:28 +0300 Subject: [PATCH 1/2] =?UTF-8?q?Array,=20stdClass=20yap=C4=B1ld=C4=B1.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BasicDB.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BasicDB.php b/src/BasicDB.php index 0e45690..515cd0e 100644 --- a/src/BasicDB.php +++ b/src/BasicDB.php @@ -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); From 4d856b7254c054901f4517274b9a2f11604373e4 Mon Sep 17 00:00:00 2001 From: Kerim Date: Tue, 30 Mar 2021 16:07:32 +0300 Subject: [PATCH 2/2] Dokumentasyon eklendi --- DOC.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 DOC.md diff --git a/DOC.md b/DOC.md new file mode 100644 index 0000000..0b1c4c9 --- /dev/null +++ b/DOC.md @@ -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 + ... +) +``` \ No newline at end of file