Help!!! Problem with list table
Posted: Thu Nov 19, 2009 12:12 pm
hy everyone,
Im trying to list the personal stats of some client... for that im using this code....
But im having a error when i try to find some client by her name....
the error is ----> Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\Secretel\pesquisar_pacientes.php on line 19
Nome da tabela => 7
The code that is in line 19 is the second while...
Hope u can help me,
Im trying to list the personal stats of some client... for that im using this code....
Code: Select all
<?php require_once("includes/session.php");?>
<?php require_once("includes/connection.php");?>
<?php require_once("includes/functions.php");?>
<title>Pesquisar Clientes</title>
<?php if(isset($_POST['submit']))
{
$nome =($_POST['nome']);
$executa="SHOW TABLES";
echo "<center><font face=Verdana size=2><b>Tabelas da base de dados</b></font></center><br>";
$query = mysql_query("SELECT * FROM pacientes WHERE nome = '".mysql_real_escape_string($nome)."'");
echo "<table>";
while ($dados=mysql_fetch_array($query)) {
echo "<tr><td><font face=Verdana size=2 color=#333300><B>Nome
da tabela => $dados[0]</td></tr>";
$executa="DESCRIBE $dados[0]";
$aux=mysql_query($executa);
while ($atributos=mysql_fetch_array($aux)) {
echo "<tr><td><font face=Verdana size=1>$atributos[0]</td><td>
<font face=Verdana size=1>| $atributos[1]</td><td>
<font face=Verdana size=1>| $atributos[3]</td></tr>"; }
echo "</table>"; }
}else { $nome = '';}
?>
<h1><center> Pesquisar Clientes </center></h1><br/>
<!--------INSERIR CLIENTES--------->
<form action="pesquisar_pacientes.php" method="post">
<table>
<tr><td>Nome:</td>
<td><input type="text" name="nome" maxlength="30" value="<?php echo htmlentities($nome); ?>"/></td></tr>
<tr><td colspan="2"><input type="submit" name="submit" value="Pesquisar" /></td></tr>
</table>
</form>But im having a error when i try to find some client by her name....
the error is ----> Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\Secretel\pesquisar_pacientes.php on line 19
Nome da tabela => 7
The code that is in line 19 is the second while...
Code: Select all
while ($atributos=mysql_fetch_array($aux)) {Hope u can help me,