Created
January 2, 2015 23:19
-
-
Save ClaudioHenrique/967ea6cb79588decb277 to your computer and use it in GitHub Desktop.
Consulta ao Banco.
This file contains 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
function search($id){ | |
$sql = "SELECT id,value,type FROM mt_type WHERE fk_questao = :id"; | |
try{ | |
$db = getConnection(); | |
$stmt = $db->prepare($sql); | |
$stmt->bindParam('id',$id); | |
$stmt->execute(); | |
$result = $stmt->fetchAll(PDO::FETCH_ASSOC); | |
}catch(PDOException $e){ | |
echo $e->getMessage(); | |
} | |
echo json_encode($result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment