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
This commit is contained in:
11
dblayer.php
11
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 :
|
||||
|
||||
Reference in New Issue
Block a user