Last active
August 29, 2015 13:56
-
-
Save fatorx/8967740 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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