4
When I enter the page PHP already has an error:
Notice: Undefined index: name in C: wamp www index.php on line 41
Here is the code:
include ("conexao.php");
$nome = $_POST["nome"];
$resul = mysql_query("SELECT * FROM funcionarios WHERE nome = '$nome'");
while($row = mysql_fetch_array($resul))
{
print "
<tr align='center'>
<td> $row[id_funcionario] </td>
<td> $row[nome] </td>
<td> $row[idade] </td>
<td> $row[sobrenome] </td>
<td> $row[senha] </td>
</tr>
";
}
Checking for value in a PHP array?
Execute the following code in this file: var_dump($_POST) and show us the result through the comments.
– Júnior
Unrelated to the question, but your code has a very high risk of suffering an attack called SQL Injection. I suggest reading this question after solving the problem of the variable: http://answall.com/questions/3864/
– Bacco
The question title is misplaced. The problem is an undefined array index. To avoid this error, just follow the tips posted about using isset()
– Daniel Omine