Jump to content
Fórum Script Brasil
  • 0

Erro com consulta sql.


rfrancisco

Question

<?php

$cod = $_GET["cod"];

$sql = "SELECT * FROM imoveis WHERE codigo=$cod'";

$resultado = mysql_query($sql)

or die (mysql_error());

while ($dados=mysql_fetch_array($resultado)) {

$corretor = $dados["corretor];

echo "<form action=\"insere_imovel.php\" method=\"POST\" enctype=\"multipart/form-data\">";

echo "<p>";

echo "Corretor:";

echo "<select name=\"corretor\">";

$sql = mysql_query("SELECT * FROM corretores");

while($dados = mysql_fetch_array($sql)){

echo "<option selected='selected' value='".$dados['id']."'>".$dados['nome']."</option>";

}

echo "</select>";

}

else {

echo "Você não está logado.";

echo "<form method=\"POST\" action=\"login.php\">";

echo "<input type=\"text\" name=\"username\" value=\"Usuário\" size=\"10\"><input type=\"password\" name=\"password\" value=\"Senha\" size=\"10\"><input type=\"submit\" value=\"Enviar\" name=\"enviar\">";

}

mysql_close($conexao);

?>

Recebo este erro: Parse error: syntax error, unexpected T_ELSE in /home/httpd/vhosts/algumacoisa.org/httpdocs/bqimoveis/cadastra_imovel.php on line 74.

Alguma sugestão?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...