preencher formulário com dados obtidos no mysql
Olá,
O código abaixo faz um select dentro do mysql com dados de um formulário preenchido anteriormente, o resultado deve preencher os campos de um outro formulário onde poderei alterar os dados para poder salvar no mysql. Porém apresenta erro, e não estou conseguindo achar algo parecido na internet.
<?php
include "conexao.php";
$matricula=$_POST['matricula'];
$filial=$_POST['filial'];
$result = mysql_query("SELECT matricula, nome, departamento, lotacao, habilitacao, data_admissao, data_demissao, senha, status
FROM ".$filial." WHERE matricula=".$matricula."") or die(mysql_error());
echo "<table border='1'>
<tr>
<th>Matricula</th>
<th>Nome</th>
<th>Departamento</th>
<th>Lotação</th>
<th>Habilitação</th>
<th>Data de Admissão</th>
<th>Data de Demissão</th>
<th>Senha</th>
<th>Status</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>"
echo "<td>" "<input type="text" name="matricula" value=".$row['nome'].">" "</td>"
echo "<td>" "<input type="text" name="nome" value=".$row['matricula'].">" "</td>"
echo "<td>" "<input type="text" name="departamento" value=".$row['departamento'].">" "</td>"
echo "<td>" "<input type="text" name="lotacao" value=".$row['lotacao'].">" "</td>"
echo "<td>" "<input type="text" name="habilitacao" value=".$row['habilitacao'].">" "</td>"
echo "<td>" "<input type="text" name="data_admissao" value=".$row['data_admissao'].">" "</td>"
echo "<td>" "<input type="text" name="data_demissao" value=".$row['data_demissao'].">" "</td>"
echo "<td>" "<input type="text" name="senha" value=".$row['senha'].">" "</td>"
echo "<td>" "<input type="text" name="status" value=".$row['status'].">" "</td>"
echo "<td>" "<input name="atualizar" type="button" value="atualizar">" "</td>"
echo "</tr>"
}
?>
O erro está aqui:
Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in G:\Program Files\EasyPHP-5.3.6.0\www\senha\atualiza_search.php on line 28
Discussão (6)
Carregando comentários...