FaaPz/PDO

Raw Query ?

Closed this issue · 2 comments

Is there any way to write raw query ? This feature is needed for some complex queries

Yes, its built on top of PDO and you can still use funcions like prepare(), bindParam(), execute () and so on.

@im-madman An example is always nicer. Here's one I needed to do for an unsupported functionality (getting all column data from a table):

$db = new \Slim\PDO\Database($dsn, $usr, $pwd);
$stmt = $db->query('SHOW COLUMNS FROM table_name')
$stmt->execute();
$columns = $stmt->fetchAll();