Raw Query ?
Closed this issue · 2 comments
im-madman commented
Is there any way to write raw query ? This feature is needed for some complex queries
lhsazevedo commented
Yes, its built on top of PDO and you can still use funcions like prepare(), bindParam(), execute () and so on.
shaq147 commented
@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();