E ae galera, tudo beleza?? =] Sou novo em php e gostaria de saber como eu faço para pegar os dados do banco e coloca-los em textfields... tentei de algumas formas de acordo com alguns tópicos q postaram, mas não deu certo... =/ Esse é o meu código: (pesquiso o cpf e mostro os dados em outra página) o que esta errado nele? *****************************Página para pesquisar os dados através do cpf********************************************************** <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- .style1 {font-family: Arial, Helvetica, sans-serif} .style2 {font-family: Arial, Helvetica, sans-serif; font-size: 36px; } --> </style> </head> <body> <form action="Consulta.php" method="post"> <p class="style2"><u>Pesquisar Cliente</u> </p> <p class="style1">Digite o cpf: <input name="txtBuscaCpf" type="text" id="txtBuscaCpf" /> </p> <form id="form1" name="form1" method="post" action=""> <label></label> <label> <input type="submit" name="Submit" value="Pesquisar" /> </label> </form> </form> </body> </html> ---------------------------------------------------------------------------------------------------------------------------------------------------------------- ****************************Página para obter os dados do banco e mostrar nos textfields(Consulta.php)************************************ <script language="php"> $conexao = mysql_connect("localhost" ,"root","") or die("conexao não estabelecida"); mysql_select_db("Banco",$conexao) or die ("erro ao selecionar o banco"); $codigo = $_GET['codigo']; $nome = $_GET['nome']; $rg = $_GET['rg']; $cpf = $_GET['cpf']; $endereco = $_GET['endereco']; $cidade = $_GET['cidade']; $estado = $_GET['estado']; $pais = $_GET['pais']; $buscacpf = $_POST["txtBuscaCpf"]; $sql = "select * from cliente where cpf = '$buscacpf'"; $resultado = mysql_query($sql, $conexao) or die (" não foi possivel executar a insercao"); $row = mysql_fetch_row(($sql); mysql_close($conexao); </script> <html> <head> <meta http-equiv=Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- .style1 {font-family: Arial, Helvetica, sans-serif} .style2 {font-family: Arial, Helvetica, sans-serif; font-size: 36px; } --> </style> </head> <body> <p class="style2"><u>Dados pessoais</u></p> <p class="style1">Código: <input name="txtCodigo" type="text" id="txtCodigo" value="<?php echo $row['codigo]; ?>"/> </p> <form action="" method="post" name="form1" class="style1" id="form1"> <label></label> <p>Nome: <input name="txtNome" type="text" id="txtNome" value="<?php echo $row['nome']; ?>"/> </p> </form> <form action=" method="post" name="form2" class="style1" id="form2"> <label></label> RG: <input name="txtRg" type="text" id="txtRg" value="<?php echo $row['rg]; ?>"/> </form> <form action="" method="post" name="form3" class="style1" id="form3" <label></label> CPF: <input name="txtCpf" type="text" id="txtCpf"value="<?php echo $row['cpf']; ?>"/> </form> <form action=" method="post" name="txtEndereco" class="style1" id="txtEndereco"> <label></label> Endereço: <input name="txtEndereco" type="text" id="txtEndereco"value="<?php echo $row['endereco]; ?>"/> </form> <form action="" method="post" name="form6" class="style1" id="form6"> <label></label> <p>Cidade: <input name="txtCidade" type="text" id="txtCidade" value="<?php echo $row['cidade']; ?>"/> </p> </form> <p class=style1">Estado: <input name="txtEstado" type="text" id="txtEstado" value="<?php echo $row['estado]; ?>"/> </p> <p class="style1">País: <input name="txtPais" type="text" id="txtPais"value="<?php echo $row['pais']; ?>"/> </p> <form id="form7" name="form7" method="post" action=""> <label> <input type="submit" name="Submit2" value="Atualizar dados" /> </label> <label> <input type="submit" name="Submit" value="Excluir Cadastro" /> </label> <p class="style1"><a href="index.html">Voltar ao Menu</a> </p> </form> <p class="style1"> </p> <form id="form5" name="form5" method="post" action=""> <label></label> </form> </body> </html> -------------------------------------------------------------------------------------------------------------------------- Se puderem me ajudar, eu agradeço ^^