Gostaria de saber porque não consigo alterar meus dados no mysql,o codigo esta certo,aparentemente pelo menos,pois é pra clicar no botao alterar e depois ele ir para o input ,dai pra mim alterar o nome dele.mas ele ao clicar em alterar ele não esta indo para o input =/
Pergunta
Dimitrov
Gostaria de saber porque não consigo alterar meus dados no mysql,o codigo esta certo,aparentemente pelo menos,pois é pra clicar no botao alterar e depois ele ir para o input ,dai pra mim alterar o nome dele.mas ele ao clicar em alterar ele não esta indo para o input =/
por favor alguém me de uma ajuda ai.
obrigado
Categoria.php
<?php include "conexao.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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <table width="750" border="0" align="center"> <tr> <td colspan="2"><?php include('cabecalho.php'); ?></td> </tr> <tr> <td width="200"><?php include('menu.php'); ?></td> <td width="583"><table width="100%" border="0"> <tr> <td> </td> </tr> <tr> <td align="center" style="font-size: 14px; text-align: center;"><p>categoria</p> <?php if ($acao != "") { $sql = mysql_query ("SELECT * from Categorias Where id_categoria = $id"); ?> <form id="form1" name="form1" method="post" action="<? echo $PHP_SELF ?>"> <table width="300" border="1" align="center" cellpadding="2" cellspacing="0"> <tr> <td width="143">Categoria</td> <td width="147"><label> <input name="txt_categoria" type="text" id="txt_categoria" size="35" value= "<?php echo @mysql_result($sql,0,categoria); ?>"/> </label></td> </tr> <tr> <td colspan="2" align="center"><label> <input type="submit" name="button" id="button" value="OK" /> </label></td> </tr> </table> </form> <?php } else { ?> <table width="99%" border="1"> <tr> <td width="90%" align="left">Categorias</td> <td colspan="2" align="center">Ação</td> </tr> <?php $sql = mysql_query ("SELECT * from categorias") or exit(mysql_error()); while ($coluna = mysql_fetch_array ($sql)) { ?> <tr> <td align="left"><?php echo $coluna[categoria] ?></td> <td width="5%"><a href="?acao=Alterar&id= <?php echo $coluna[id_categoria];?>"><img src="imagens/b_edit.gif" width="16" height="16" border = "0"/></a></td> <td width="5%"><img src="imagens/b_drop.gif" width="16" height="16" /></td> </tr> <?php } ?> <tr> <td colspan="3" align="right"><img src="imagens/b_insrow.gif" width="16" height="16" /><span style="font-size: 12px;">Inserir</span></td> </tr> </table> <?php } ?> <p> </p></td> </tr> </table></td> </tr> <tr> <td colspan="2"><?php include('rodape.php'); ?></td> </tr> </table> </body> </html>cabecalho.php<table width="779" border="0" cellspacing="0" cellpadding="0"> <tr> <td><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="9%"> </td> <td width="25%"><img src="imagens/logo.jpg" width="156" height="89" /></td> <td width="59%"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2"> </td> </tr> <tr> <td width="73%"> </td> <td width="27%"><img src="imagens/imagenadm.gif" width="169" height="40" /></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="33%"> login:</td> <td width="58%"><strong>Data:</strong><?php $dia_da_semana = array ("Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"); $num_dia = date (w); $dia_extenso = $dia_da_semana[$num_dia]; echo $dia_extenso.", ".date("d/m/Y");?> - <b> Hora: </b> <?php echo date("H:i"); ?> - <b> IP: </b> <?php echo getenv ("REMOTE_ADDR"); ?> </td> <td width="9%"> </td> </tr> </table></td> </tr> <tr> <td colspan="2"><img src="imagens/menu.gif" width="623" height="34" /></td> </tr> </table></td> <td width="7%"> </td> </tr> </table></td> </tr> <tr> <td> </td> </tr> </table>menu.php conexao.phpLink para o comentário
Compartilhar em outros sites
6 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.