Jump to content


Photo

Alterar Em Php


  • Faça o login para participar
1 reply to this topic

#1 MauricirWM

MauricirWM

    Novato no fórum

  • Usuários
  • 6 posts
  • Sexo:Não informado
  • Localidade:Matão-SP
  • Interesses:Aprender e ajudar o pessoal nesse forum.<br />

Posted 29/11/2007, 08:21

to montando um sisteminha de atualização
na hora q eu clico no link q criei pra alterar, ele não altera, já revisei o código
mais até agora não axei erro nenhum
teria como vcs darem uma olhada no código por gentileza?

esta parando nesta página

<?PHP
include "verifica.php";
 $nome=$_COOKIE["nome"];
 ?>

<?php
$conexao=mysql_connect("localhost","root","");
mysql_select_db("pava_atu");
$sql="SELECT * FROM edit_txt order by id_edit desc limit 10";
$resultado=mysql_query($sql);
?>
<table width="100" border="0" cellspacing="0" cellpadding="0">
  <tr>
	<td><img src="imgs/topo.gif" width="778" height="197" /></td>
  </tr>
  <tr>
	<td> </td>
  </tr>
  <tr>
	<td align="center"><form id="form" name="form" method="post" action="alterar_sucesso.php">
	  <table width="330" border="0">
		<tr>
		  <td width="50" align="right"><strong><font color="#7F5F27" size="2" face="Verdana, Arial, Helvetica, sans-serif">Título 
			:</font></strong></td>
		  <td width="270" valign="middle"><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <?php echo "$pegar[id_edit]"; ?>
				  <?php 
$id_edit=$_GET["id_edit"];


$conexao=mysql_connect("localhost","root","");
mysql_select_db("pava_atu");
$sql="SELECT * FROM edit_txt where id_edit='$id_edit'";
$resultado=mysql_query($sql);
or die ("Query invalida: " . mysql_error()); 
$pegar=mysql_fetch_array($resultado);
?>
				  <input name="titulo" type="text" value="<?php echo "$pegar[titulo]"; ?>" />
		  </font></strong></td>
		</tr>
		<tr>
		  <td align="right"><strong><font color="#7F5F27" size="2" face="Verdana, Arial, Helvetica, sans-serif">Texto:</font></strong></td>
		  <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
			<textarea name="texto" cols="50"rows="7" id="texto"><?php 
$id_edit=$_GET["id_edit"];

$conexao=mysql_connect("localhost","root","");
mysql_select_db("pava_atu");
$sql="SELECT * FROM edit_txt where id_edit='$id_edit'";
$resultado=mysql_query($sql);
or die ("Query invalida: " . mysql_error());
$pegar=mysql_fetch_array($resultado);

echo "$pegar[texto]";
?>
			</textarea>
		  </font></strong></td>
		</tr>
		<tr>
		  <td> </td>
		  <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
			<input name="submit" type="submit" value="Alterar" />
		  </font></strong></td>
		</tr>
	  </table>
						</form>
	<br>
	<p></p>
	</td>
  </tr>
</table>
<p> </p>
<p><br>
</p>


#2 hostdesigner

hostdesigner

    Super Veterano

  • Usuários
  • 2910 posts
  • Sexo:Masculino
  • Localidade:Quirinópolis-GO
  • Interesses:Programação, Mulheres, Diversão, Mulheres, Música, Mulheres, Meu Carro, Mais mulheres, Internet, Outras Mulheres, Quase por último PAZ e por ultimo Outras Váááárias Mulheres...

Posted 29/11/2007, 12:31

Eu não encontrei a parte onde deveria ser realizada a atualização dos dados, mas, para atualizar você precisa fazer uma consulta do tipo "UPDATE"

Veja estes exemplos http://forum.wmonlin...howtopic=103227

Falopa!

Edição feita por: hostdesigner, 29/11/2007, 12:41.





1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq