Skip to content

Instantly share code, notes, and snippets.

@fatorx
Last active August 29, 2015 13:56
Show Gist options
  • Save fatorx/8967740 to your computer and use it in GitHub Desktop.
Save fatorx/8967740 to your computer and use it in GitHub Desktop.
<?php
// Onde $this->em recebe o EntityManager
$sql = 'SELECT id,titulo FROM posts';
$stmt = $this->em->getConnection()->prepare($sqlSlug);
$stmt->bindValue(1, $slugPost);
try {
$stmt->execute();
}
catch(\Exception $e) {
echo $e->getMessage();
exit();
}
$rs = $stmt->fetch();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment