ExtremeSB Posted November 19, 2015 at 12:35 PM Report Share #589885 Posted November 19, 2015 at 12:35 PM Pesquisa nao funciona quando uso a variável, e quando uso o numero especifico funciona, mas consigo imprimir a variável no echo $id <h5><b>ID: </b><?php echo $id = "<span class=\"roomNumber\"></span>" ?></h5></br> <?php echo $id; /*Funciona*/ $sqll = "SELECT * FROM Aluno WHERE AlunoID= '2'"; /*Não Funciona*/ $sqll = "SELECT * FROM Aluno WHERE AlunoID= '$id'"; $result1 = $connection->query($sqll); $row1 = mysql_fetch_row($sqll); /*Não Imprime o nome*/ echo $row1['Nome']; print_r($result1, $return); ?> Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted November 19, 2015 at 12:57 PM Report Share #589886 Posted November 19, 2015 at 12:57 PM então diz lá qual o output do echo IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
ExtremeSB Posted November 19, 2015 at 02:00 PM Author Report Share #589889 Posted November 19, 2015 at 02:00 PM É 2 Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted November 19, 2015 at 02:06 PM Report Share #589890 Posted November 19, 2015 at 02:06 PM pelo código que apresentas, não ... <?php echo $id = "<span class=\"roomNumber\"></span>" ?> isto resulta em : <span class=\"roomNumber\"></span> olha bem o sinal de igual ali pelo meu IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
ExtremeSB Posted November 19, 2015 at 02:15 PM Author Report Share #589891 Posted November 19, 2015 at 02:15 PM Pk isso traz um id por javascript de uma outra consulta Que quando carrego no butao, ele usa o javascript para enviar o id daquela row, para a modal onde tenho esse codigo acima Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted November 19, 2015 at 02:19 PM Report Share #589892 Posted November 19, 2015 at 02:19 PM o que acabaste de dizer não faz sentido, estamos a falar de php ou javascript ? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
ExtremeSB Posted November 19, 2015 at 02:22 PM Author Report Share #589893 Posted November 19, 2015 at 02:22 PM Foi a unica maneira que encontrei de enviar um id para uma modal dialog e o <span class=\"roomNumber\"></span> contem um numero, e no echo apresentame o numero Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted November 19, 2015 at 02:29 PM Report Share #589894 Posted November 19, 2015 at 02:29 PM estamos a falar de php ou javascript ? água ou azeite ? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
ExtremeSB Posted November 19, 2015 at 02:34 PM Author Report Share #589896 Posted November 19, 2015 at 02:34 PM Php mas so consegui passar o id para uma modal com javascript Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted November 19, 2015 at 02:36 PM Report Share #589897 Posted November 19, 2015 at 02:36 PM então se o problema é javascript, o php não tem nada haver com o assunto. IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
ExtremeSB Posted November 19, 2015 at 02:40 PM Author Report Share #589898 Posted November 19, 2015 at 02:40 PM Mas passa o id direito, nsei o que fazer Link to comment Share on other sites More sharing options...
joaocasta Posted November 19, 2015 at 03:30 PM Report Share #589899 Posted November 19, 2015 at 03:30 PM Para começar tenta explicar concretamente o que pretendes. O teu problema é relacionado com Javascript. O que podes fazer é criar um input hidden e colocar no value o ID Link to comment Share on other sites More sharing options...
acao Posted November 19, 2015 at 03:44 PM Report Share #589900 Posted November 19, 2015 at 03:44 PM (edited) boas vê se na variável junto às ' não falta um ponto. $sqll = "SELECT * FROM Aluno WHERE AlunoID= '.$id.'"; cumps acao Edited November 19, 2015 at 03:58 PM by acao Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now