Created
September 10, 2018 12:08
-
-
Save ojulianos/31a223532e8dbf95ac1046972c7a7129 to your computer and use it in GitHub Desktop.
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
<?php | |
$sqlNotificacao = "(SELECT n.mensagem FROM notificacao n WHERE n.id_aluno = a.id_aluno ORDER BY id_notificacao LIMIT 1 ) AS notificacao"; | |
$sqlAcademia = "(SELECT academia.nome FROM academia WHERE academia.id_academia = a.id_academia) as academia"; | |
$sqlselect = "SELECT a.*, $sqlAcademia, $sqlNotificacao FROM aluno a WHERE a.id_aluno =:id_aluno LIMIT 1"; | |
$stmt = $db->prepare($sqlselect); | |
$stmt->bindParam("id_aluno", $id_aluno, PDO::PARAM_INT); | |
$stmt->execute(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment