Ir para conteúdo
Fórum Script Brasil

CRISVAZ

Membros
  • Total de itens

    4
  • Registro em

  • Última visita

Tudo que CRISVAZ postou

  1. CRISVAZ

    UPDATE * por id

    Deu certinho ...... Conforme você falou .... também tinha esquecido do ' no id='id'.... <?php error_reporting (E_ALL & ~ E_NOTICE & ~ E_DEPRECATED); $id = $_GET['id']; $nome=$_GET['nome']; $senha=$_GET['senha']; $conexao=mysql_connect("localhost","root", ""); mysql_select_db("db_aula", $conexao); $sql="UPDATE tb_aula SET nome='$nome', senha='$senha' WHERE id='$id'"; $linha=mysql_query($sql, $conexao) or die (mysql_error()."".$sql); ?> Obrigado !!!
  2. CRISVAZ

    UPDATE * por id

    Tentei colocar ... fiz os codigos assim <?php $id = $_GET['id']; $nome=$_GET['nome']; $senha=$_GET['senha']; $conexao=mysql_connect("localhost","root", ""); mysql_select_db("db_aula", $conexao); $sql="UPDATE tb_aula SET nome='$nome', senha='$senha'WHERE id=$id'"; $linha=mysql_query($sql, $conexao) or die (mysql_error()."".$sql); $registro= mysql_fetch_array($linha); ?> porém o erro insiste ... será que tenho que criar variável editar? ( ! ) Notice: Undefined index: nome in C:\wamp\www\aula\acaoupdate.php on line 4Call Stack#TimeMemoryFunctionLocation10.0010136272{main}( )..\acaoupdate.php:0 ( ! ) Notice: Undefined index: senha in C:\wamp\www\aula\acaoupdate.php on line 5Call Stack#TimeMemoryFunctionLocation10.0010136272{main}( )..\acaoupdate.php:0 ( ! ) Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp\www\aula\acaoupdate.php on line 7Call Stack#TimeMemoryFunctionLocation10.0010136272{main}( )..\acaoupdate.php:020.0020136904mysql_connect ( )..\acaoupdate.php:7Erreur de syntaxe près de ''' à la ligne 1UPDATE tb_aula SET nome='', senha=''WHERE id=32' wootzor, Tem outra forma de update, com pagina de comando ? Obrigado!
  3. CRISVAZ

    UPDATE * por id

    ( ! ) Notice: Undefined index: nome in C:\wamp\www\aula\acaoupdate.php on line 7Call Stack#TimeMemoryFunctionLocation10.0010135784{main}( )..\acaoupdate.php:0 ( ! ) Notice: Undefined index: senha in C:\wamp\www\aula\acaoupdate.php on line 8Call Stack#TimeMemoryFunctionLocation10.0010135784{main}( )..\acaoupdate.php:0 ( ! ) Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp\www\aula\acaoupdate.php on line 10Call Stack#TimeMemoryFunctionLocation10.0010135784{main}( )..\acaoupdate.php:020.0186143776mysql_connect ( )..\acaoupdate.php:10Erreur de syntaxe près de '='', senha=''WHERE id=$id' à la ligne 1-UPDATE tb_aulaSET nome='', senha=''WHERE id=$id Esta dando esse erro ..
  4. CRISVAZ

    UPDATE * por id

    Pessoal, Boa tarde! Feriadão e eu nos estudos....rsrsrs Sobre o PHP Não consigo fazer o UPDATE para modificar os arquivos.... Será que estou esquecendo alguma variável ? db_aula tb_aula Campos nome e senha .... O php editar ta assim .......... formulario_editar_________________________________ <?php error_reporting (E_ALL & ~ E_NOTICE & ~ E_DEPRECATED); $host="localhost"; // Host name $user="root"; // Mysql username $pass="***"; // Mysql password $banco="db_aula"; // Database name $tabela="tb_aula"; // Table name // Connect to server and select database. mysql_connect("$host", "$user", "$pass")or die("cannot connect"); mysql_select_db("$banco")or die("cannot select DB"); // get value of id that sent from address bar $id=$_GET['id']; // Retrieve data from database $sql="SELECT * FROM $tabela WHERE id='$id'"; $result=mysql_query($sql); $linha=mysql_fetch_array($result); ?> <fieldset style="background-color:#06F" padding: 0%><legend>Aula 01</legend> <center><h2>Área Restrita</h2></center> <center> <form action="acaoupdate.php" method="get" > <input type="text" value="<?php echo @$linha['nome']; ?>"/><br/><br/> <input type="text" value="<?php echo @$linha['senha']; ?>"/><br/><br/> <input type="submit" value=" Alterar " />&nbsp;&nbsp; <input type="reset" value="Limpar" /> </form> </center> </fieldset> ______________________________________________________________________________________________________________ Dai a acaoupdate.php ( o que não vai ....rsrsrs) Ta assim ... acaoupdate,php _____________________________________ <?php $id = $_GET['id']; $nome=$_GET['nome']; $senha=$_GET['senha']; $conexao=mysql_connect("localhost","root", "pretinha"); mysql_select_db("bd_aula", $conexao); $sql="UPDATE tb_aula"; $sql.="SET nome='$nome', senha='senha'"; $sql.="WHERE id=".$id; $rs=mysql_query($sql, $conexao) or die (mysql_error()."-".$sql); $registro= mysql_fetch_array($rs); ?> ____________________________ Se tiver forma mais fácil de fazer uma modificação ....... tó travandop nisso.... e se for do meu jeeito aonde que estou errando ... Abraçosss...
×
×
  • Criar Novo...