Jump to content

PHP nao funciona quando uso varíavel


Recommended Posts

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>
   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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.