Ir para conteúdo
Fórum Script Brasil

ssornelas

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Sobre ssornelas

ssornelas's Achievements

0

Reputação

  1. Ola Galera... sou novo no php e estou tentado descobrir como faço para carregar os dados cadastrados preoviamente no banco de dados, no combobox do formulário edit.php. Não estou conseguindo que as informações dos individuos listado no fromulário listagem.php, apareção do formulario edit.php codigo... formulário listagem.php <!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> <title>Untitled Document</title> </head> <body> <?php include("conexao.php"); $sql = mysql_query("select * from testecombobox "); while( $exibe = mysql_fetch_assoc($sql)): echo "<a href='listareditar.php?&id=".$exibe['id']."'>Editar</a> | "; echo $exibe["id"]." | "; echo utf8_encode($exibe["cmbitens"])." | "; endwhile; ?> </body> </html> foemulário edit.php <?php include("conexao.php"); $id = $_GET["id"]; $sql = mysql_query("select * from testecombobox where id='$id'"); $exibe = mysql_fetch_assoc($sql); ?> <form action="up.php" method="post"> <fieldset><legend>teste</legend> <p> <select name="cmbitens" id="cmbitens" title="cmbitens" > <?php $valor = $_POST['cmbitens']; ?> <option value="item 1">item1</option> <option value="item 2">item2</option> <option value="item 3">item3</option> </select> </p> <p> <input type="submit" name="enviar" id="enviar" value="Submit"> </p> </fieldset> </form> arquivo up.php <?php include ("conexao.php"); $id=$_POST['id']; $cmbitens=$_POST['cmbitens']; if(mysql_query("update testecombobox set cmbitens='$cmbitens' where id='$id'")){ echo "Alterado! <br> <a href='javascript:history.back(-1);'>Voltar</a>"; exit; }else { echo mysql_error(); exit; } ?> alguém consegue me dar uma luz?
×
×
  • Criar Novo...