Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question #25

Closed
salt-lick opened this issue Feb 9, 2016 · 2 comments
Closed

Question #25

salt-lick opened this issue Feb 9, 2016 · 2 comments
Labels

Comments

@salt-lick
Copy link

Would it be possible to add the ability to execute raw SQL commands with this package?

@FaaPz FaaPz added the question label Feb 10, 2016
@FaaPz
Copy link
Owner

FaaPz commented Feb 10, 2016

Hi @salt-lick, that's already possible. 😉 Slim-PDO extends raw PDO, so you could do something like:

$dbc = new \Slim\PDO\Database($dsn, $usr, $pwd);

$query = $dbc->prepare("SELECT * FROM `users`");

$result = $query->execute();

try
{
  var_dump($result->fetchAll());
}
catch(\PDOException $e)
{
  exit($e->getMessage());
}

@FaaPz FaaPz closed this as completed Feb 10, 2016
@salt-lick
Copy link
Author

Thank you. It was a long night and things were just not clicking...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants