Warning: mysql_query() expects parameter 1 to be string, resource give
Salve pessoal!
Preciso de um help!
Esta dando esse erro:
Warning: mysql_query() expects parameter 1 to be string, resource given in /home/nhp/public_html/consultorio/visualizar_pacientes.php on line 30
O arquivo: visualizar_pacientes.php
<html xmlns="[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)" xml:lang="pt-br" lang="pt-br">
<head>
<meta http-equiv="content-Type" content="text/html; charset=iso-8859-1" />
<STYLE type="text/css">
a:link {text-decoration: none;color: #000099}
a:active {text-decoration: none;}
a:visited {text-decoration: none;color: #000099}
a:hover {text-decoration: underline;color: #000099}
body,td,th {
font-family: Arial;
color: #000000;
}
</STYLE>
<title>Visualizar pacientes</title>
</head>
<body bgcolor="#CCCC99" topmargin="0" basemargin="0">
<?php
include("conexao.php");
@$getId = $_GET['id']; //pega id
if(@$getId){
$sql = mysql_query("select * from usuariostb WHERE id = $getId");
$row = mysql_num_rows($sql);
if($row > 0){
$linha = mysql_fetch_array($sql);
$query = mysql_query($sql);
while($resultado = mysql_fetch_assoc($sql));
// while($exibe = mysql_fetch_assoc($sql));
echo "<br><br><li>","CPF: ". $linha['cpf']. "</li>",
"<li>","Prontuário: ".$linha['prontuario']. "</li>",
"<li>","Nome: ".$linha['nome']. " ".$sobrenome = $linha['sobrenome']. "</li>",
"<li>","Cor: ".$linha['cor']. "</li>",
"<li>","Endereço: ".$linha['endereco_rua']. "</li>",
"<li>","Bairro: ".$linha['endereco_bairro']. "</li>",
"<li>","Cidade: ".$linha['endereco_cidade']. "</li>",
"<li>","Estado: ".$linha['endereco_estado']. "</li>",
"<li>","Telefone Fixo: ".$linha['telefone_01']. "</li>",
"<li>","Telefone Celular: ".$linha['telefone_02']. "</li>",
"<li>","Telefone Recado: ".$linha['telefone_03']. "</li>",
"<li>","E-mail: ".$linha['email']. "</li>",
"<li>","Idade: ".$linha['idade']. "</li>",
"<li>","Ativa: ".$linha['ativa']. "</li>",
"<li>","Descrição: ".$linha['descricao']. "</li>","<br/><br/>";
// echo "<a href='editar_pacientes.php?&id=".$getId['id']."'>Editar</a>";
echo '<p>'.$cpf.'</p>'."<a href='editar_pacientes.php?&id=".$linha['id']."'>Editar</a>";
echo " | ";
echo "<a href='".$PHP_SELF."' class=sty1 onClick=\"if(confirm('Confirma exclusão do paciente:\\n".$linha['nome']." ".$sobrenome = $linha['sobrenome']." ?')){window.location='delete.php?id=$id';}return false\">Excluir</a>";
echo " | ";
echo "<a href=\"javascript:window.print()\">Imprimir</a>";
echo "<br><br>";
echo "<a href=\"javascript:history.go(-1)\">Voltar</a>";
}
else
{
echo "Erro ao Buscar dados!!!";
}
}
?><br>
</body>
</html>
Desde já obrigado!!!
Discussão (1)
Carregando comentários...