From 21964e47b082b1b7dcaccd5957862eb138491dba Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Wed, 18 Jun 2014 11:57:11 +0000 Subject: [PATCH] Add directRead to dblayer to solve the problem of read with OR in WHERE clause git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1470 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- dblayer.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/dblayer.php b/dblayer.php index f82270e..3db25cd 100644 --- a/dblayer.php +++ b/dblayer.php @@ -776,6 +776,17 @@ class dblayer extends PDO return $this->db->exec($sql); } + /** This function permit to send a SQL request to the database to do a SELECT + Return the an array with the datas */ + public function directRead ($sql) + { + $st = $this->db->prepare ($sql); + $st->execute (); + $res = array (); + while ($d = $st->fetch (PDO::FETCH_ASSOC)) + $res[] = $d; + return $res; + } } /** POC :