Ir ao conteúdo
  • Cadastre-se

WeslleySTK

Membro Júnior
  • Posts

    6
  • Cadastrado em

  • Última visita

Reputação

0
  1. Você tem essas informações: Ex: Nome: Jose Sb_Nome: Silva Idade: 40 Agora vou alterar o sb_nome para (Silveira). Ele nao muda e ainda apaga alguns registro que estar nele Ex: Nome: Sb_Silva: Silva Idade: assim que acontece! ou se existe outra maneira de altera varias info. simultâneo mais sem que danifique as info. existente!
  2. Alterar ate que altera mais não vai conforme eu quero <?php// definições de host, database, usuário e senha$host = "fdb12.freehostingeu.com";$db = "1726185_data";$user = "1726185_data";$pass = "parrokia14";// conecta ao banco de dados$con = mysql_pconnect($host, $user, $pass) or trigger_error(mysql_error(),E_USER_ERROR); // seleciona a base de dados em que vamos trabalharmysql_select_db($db, $con);// cria a instrução SQL que vai selecionar os dados$query =("SELECT * FROM fichas");// executa a query$dados = mysql_query($query, $con) or die(mysql_error());// transforma os dados em um array$linha = mysql_fetch_assoc($dados);// calcula quantos dados retornaram$total = mysql_num_rows($dados);?><html> <head> <title>CONSULTA DE FICHAS</title></head><body><table width="850" border="0"> <tr> <th width="335" height="44" scope="col"><a href="javascript:history.go(-1)"><img src="img/voltar.png" width="259" height="42" /></a></th> <th width="321" scope="col"><a href="tela_principal.php"><img src="img/home.png" width="87" height="59" /> </a></th> <th width="160" scope="col"><a href="editar_ficha.html"><img src="img/editar.png" width="87" height="59" /> </a></th> </tr></table><body bgcolor="#000000"><?php // se o número de resultados for maior que zero, mostra os dados if($total > 0) { // inicia o loop que vai mostrar todos os dados do {?><form action="editar_ficha.php" method="post"><table align="center"><td width="204">/></td><td style="color:#FFF" align="center" width="222"><font size="2" face="Arial Black, Gadget, sans-serif" color="#FFFFFF">CODÍGO DA FICHA:<fieldset style="width:50%;"><?=$linha['cod_ficha']?></fieldset></font></td><td width="189">/></td></table><table width="639" align="center"><td style="color:#FFF" align="center" width="209"><font size="2" face="Arial Black, Gadget, sans-serif" color="#FFFFFF">NOME DA FICHA:<input type="text" name="nome_ficha" value="<?=$linha['nome_ficha']?>"/></font></td><td style="color:#FFF" align="center" width="219"><font size="2" face="Arial Black, Gadget, sans-serif" color="#FFFFFF">DATA DE CADASTRO:<input name="data_cad" type="text" value="<?=$linha['data_cad']?>"/></font></td><td style="color:#FFF" align="center" width="195"><font size="2" face="Arial Black, Gadget, sans-serif" color="#FFFFFF">INSTRUTOR/PERSONAL:<input name="personal" type="text" value="<?=$linha['personal']?>"/></font></td></table><table width="639" align="center"><td style="color:#FFF" align="center" width="211"><font size="2" face="Arial Black, Gadget, sans-serif" color="#FFFFFF">INICIO DO TREINAMENTO:<input name="inicio" type="text" value="<?=$linha['inicio']?>"/></font></td><td style="color:#FFF" align="center" width="218"><font size="2" face="Arial Black, Gadget, sans-serif" color="#FFFFFF">TERMINO DO TREINAMENTO:<input name="fim" type="text" value="<?=$linha['fim']?>"/></font></td><td style="color:#FFF" align="center" width="194"><font size="2" face="Arial Black, Gadget, sans-serif" color="#FFFFFF">OBJETIVO:<input name="objetivo" type="text" value="<?=$linha['objetivo']?>"/></font></td></table><br/><br/><br/><table align="center" width="562" bordercolor="#FFFFFF" border="1"> <tr> <th style="color:#FFF" scope="col">SEGUNDA-FEIRA</th> <th style="color:#FFF" scope="col">TERÇ-FEIRA</th> <th style="color:#FFF" scope="col">QUARTA-FEIRA</th> <th style="color:#FFF" scope="col">QUINTA-FEIRA</th> </tr> <tr> <th style="color:#FFF" scope="row"><input type="text" name="a01" value="<?=$linha['a01']?>"/></th> <td style="color:#FFF" align="center"><input name="b01" type="text" value="<?=$linha['b01']?>"/></td> <td style="color:#FFF" align="center"><input name="c01" type="text" value="<?=$linha['c01']?>"/></td> <td style="color:#FFF" align="center"><input name="d01" type="text" value="<?=$linha['d01']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="a02" type="text" value="<?=$linha['a02']?>"/></th> <td style="color:#FFF" align="center"><input name="b02" type="text" value="<?=$linha['b02']?>"/></td> <td style="color:#FFF" align="center"><input name="c02" type="text" value="<?=$linha['c02']?>"/></td> <td style="color:#FFF" align="center"><input name="d02" type="text" value="<?=$linha['d02']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="a03" type="text" value="<?=$linha['a03']?>"/></th> <td style="color:#FFF" align="center"><input name="b03" type="text" value="<?=$linha['b03']?>"/></td> <td style="color:#FFF" align="center"><input name="c03" type="text" value="<?=$linha['c03']?>"/></td> <td style="color:#FFF" align="center"><input name="d03" type="text" value="<?=$linha['d03']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="a04" type="text" value="<?=$linha['a04']?>"/></th> <td style="color:#FFF" align="center"><input name="b05" type="text" value="<?=$linha['b04']?>"/></td> <td style="color:#FFF" align="center"><input name="c05" type="text" value="<?=$linha['c04']?>"/></td> <td style="color:#FFF" align="center"><input name="d05" type="text" value="<?=$linha['d04']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="a05" type="text" value="<?=$linha['a05']?>"/></th> <td style="color:#FFF" align="center"><input name="b05" type="text" value="<?=$linha['b05']?>"/></td> <td style="color:#FFF" align="center"><input name="c05" type="text" value="<?=$linha['c05']?>"/></td> <td style="color:#FFF" align="center"><input name="d05" type="text" value="<?=$linha['d05']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="a06" type="text" value="<?=$linha['a06']?>"/></th> <td style="color:#FFF" align="center"><input name="b06" type="text" value="<?=$linha['b06']?>"/></td> <td style="color:#FFF" align="center"><input name="c06" type="text" value="<?=$linha['c06']?>"/></td> <td style="color:#FFF" align="center"><input name="d06" type="text" value="<?=$linha['d06']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="a07" type="text" value="<?=$linha['a07']?>"/></th> <td style="color:#FFF" align="center"><input name="b07" type="text" value="<?=$linha['b07']?>"/></td> <td style="color:#FFF" align="center"><input name="c07" type="text" value="<?=$linha['c07']?>"/></td> <td style="color:#FFF" align="center"><input name="d07" type="text" value="<?=$linha['d07']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="a08" type="text" value="<?=$linha['a08']?>"/></th> <td style="color:#FFF" align="center"><input name="b08" type="text" value="<?=$linha['b08']?>"/></td> <td style="color:#FFF" align="center"><input name="c08" type="text" value="<?=$linha['c08']?>"/></td> <td style="color:#FFF" align="center"><input name="d08" type="text" value="<?=$linha['d08']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="a09" type="text" value="<?=$linha['a09']?>"/></th> <td style="color:#FFF" align="center"><input name="b09" type="text" value="<?=$linha['b09']?>"/></td> <td style="color:#FFF" align="center"><input name="c09" type="text" value="<?=$linha['c09']?>"/></td> <td style="color:#FFF" align="center"><input name="d09" type="text" value="<?=$linha['d09']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="a10" type="text" value="<?=$linha['a10']?>"/></th> <td style="color:#FFF" align="center"><input name="b10" type="text" value="<?=$linha['b10']?>"/></td> <td style="color:#FFF" align="center"><input name="c10" type="text" value="<?=$linha['c10']?>"/></td> <td style="color:#FFF" align="center"><input name="d10" type="text" value="<?=$linha['d10']?>"/></td> </tr></table><table bordercolor="#FFFFFF" align="center" width="393" border="1"> <tr> <th style="color:#FFF" scope="col">SEXTA-FEIRA</th> <th style="color:#FFF" scope="col">SABADO</th> <th style="color:#FFF" scope="col">DOMINGO/></th> </tr> <tr> <th style="color:#FFF" scope="row"><input name="e01" type="text" value="<?=$linha['e01']?>"/></th> <td style="color:#FFF" align="center"><input name="f01" type="text" value="<?=$linha['f01']?>"/></td> <td style="color:#FFF" align="center"><input name="g01" type="text" value="<?=$linha['g01']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="e02" type="text" value="<?=$linha['e02']?>"/></th> <td style="color:#FFF" align="center"><input name="f02" type="text" value="<?=$linha['f02']?>"/></td> <td style="color:#FFF" align="center"><input name="g02" type="text" value="<?=$linha['g02']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="e03" type="text" value="<?=$linha['e03']?>"/></th> <td style="color:#FFF" align="center"><input name="f03" type="text" value="<?=$linha['f03']?>"/></td> <td style="color:#FFF" align="center"><input name="g03" type="text" value="<?=$linha['g03']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="e04" type="text" value="<?=$linha['e04']?>"/></th> <td style="color:#FFF" align="center"><input name="f04" type="text" value="<?=$linha['f04']?>"/></td> <td style="color:#FFF" align="center"><input name="g04" type="text" value="<?=$linha['g04']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="e05" type="text" value="<?=$linha['e05']?>"/></th> <td style="color:#FFF" align="center"><input name="f05" type="text" value="<?=$linha['f05']?>"/></td> <td style="color:#FFF" align="center"><input name="g05" type="text" value="<?=$linha['g05']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="e06" type="text" value="<?=$linha['e06']?>"/></th> <td style="color:#FFF" align="center"><input name="f06" type="text" value="<?=$linha['f06']?>"/></td> <td style="color:#FFF" align="center"><input name="g06" type="text" value="<?=$linha['g06']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="e07" type="text" value="<?=$linha['e07']?>"/></th> <td style="color:#FFF" align="center"><input name="f07" type="text" value="<?=$linha['f07']?>"/></td> <td style="color:#FFF" align="center"><input name="g07" type="text" value="<?=$linha['g07']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="e08" type="text" value="<?=$linha['e08']?>"/></th> <td style="color:#FFF" align="center"><input name="f08" type="text" value="<?=$linha['f08']?>"/></td> <td style="color:#FFF" align="center"><input name="g08" type="text" value="<?=$linha['g08']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="e09" type="text" value="<?=$linha['e09']?>"/></th> <td style="color:#FFF" align="center"><input name="f09" type="text" value="<?=$linha['f09']?>"/></td> <td style="color:#FFF" align="center"><input name="g09" type="text" value="<?=$linha['g09']?>"/></td> </tr> <tr> <th style="color:#FFF" scope="row"><input name="e10" type="text" value="<?=$linha['e10']?>" /></th> <td style="color:#FFF" align="center"><input name="f10" type="text" value="<?=$linha['f10']?>" /></td> <td style="color:#FFF" align="center"><input name="g10" type="text" value="<?=$linha['g10']?>" /></td> </tr></table><div align="center"><input type="submit" value="ALTERAR" /></div></form></body></html><?php // finaliza o loop que vai mostrar os dados }while($linha = mysql_fetch_assoc($dados)); // fim do if }?><?php// tira o resultado da busca da memóriamysql_free_result($dados);?> <?php//conexao$conn = mysqli_connect("fdb12.freehostingeu.com","1726185_data","parrokia14","1726185_data")or die("Erro:" .mysqli_error($conn));//Recebendo informacoes do formulario$a01 = $_POST['a01'];$a02 = $_POST['a02'];$a03 = $_POST['a03'];$a04 = $_POST['a04'];$a05 = $_POST['a05'];$a06 = $_POST['a06'];$a07 = $_POST['a07'];$a08 = $_POST['a08'];$a09 = $_POST['a09'];$a10 = $_POST['a10'];$b01 = $_POST['b01'];$b02 = $_POST['b02'];$b03 = $_POST['b03'];$b04 = $_POST['b04'];$b05 = $_POST['b05'];$b06 = $_POST['b06'];$b07 = $_POST['b07'];$b08 = $_POST['b08'];$b09 = $_POST['b09'];$b10 = $_POST['b10'];$c01 = $_POST['c01'];$c02 = $_POST['c02'];$c03 = $_POST['c03'];$c04 = $_POST['c04'];$c05 = $_POST['c05'];$c06 = $_POST['c06'];$c07 = $_POST['c07'];$c08 = $_POST['c08'];$c09 = $_POST['c09'];$c10 = $_POST['c10'];$d01 = $_POST['d01'];$d02 = $_POST['d02'];$d03 = $_POST['d03'];$d04 = $_POST['d04'];$d05 = $_POST['d05'];$d06 = $_POST['d06'];$d07 = $_POST['d07'];$d08 = $_POST['d08'];$d09 = $_POST['d09'];$d10 = $_POST['d10'];$e01 = $_POST['e01'];$e02 = $_POST['e02'];$e03 = $_POST['e03'];$e04 = $_POST['e04'];$e05 = $_POST['e05'];$e06 = $_POST['e06'];$e07 = $_POST['e07'];$e08 = $_POST['e08'];$e09 = $_POST['e09'];$e10 = $_POST['e10'];$f01 = $_POST['f01'];$f02 = $_POST['f02'];$f03 = $_POST['f03'];$f04 = $_POST['f04'];$f05 = $_POST['f05'];$f06 = $_POST['f06'];$f07 = $_POST['f07'];$f08 = $_POST['f08'];$f09 = $_POST['f09'];$f10 = $_POST['f10'];$g01 = $_POST['g01'];$g02 = $_POST['g02'];$g03 = $_POST['g03'];$g04 = $_POST['g04'];$g05 = $_POST['g05'];$g06 = $_POST['g06'];$g07 = $_POST['g07'];$g08 = $_POST['g08'];$g09 = $_POST['g09'];$g10 = $_POST['g10'];$ob = $_POST['objetivo'];$in = $_POST['inicio'];$fim = $_POST['fim'];$per = $_POST['personal'];$nome_ficha= $_POST['nome_ficha'];$data_cad= $_POST['data_cad'];$cod_ficha = ['cod_ficha'];//Efetuar a inclusao $edit= "UPDATE fichas SET a01='$a01',a02='$a02',a03='$a03',a04='$a04',a05='$a05',a06='$a06',a07='$a07',a08='$a08',a09='$a09',a10='$a10',b01='$b01',b02='$b02',b03='$b03',b04='$b04',b05='$b05',b06='$b06',b07='$b07',b08='$b08',b09='$b09',b10='$b10',c01='$b01',c02='$b02',c03='$b03',c04='$b04',c05='$b05',c06='$b06',c07='$b07',c08='$b08',c09='$b09',c10='$b10',d01='$b01',d02='$b02',d03='$b03',d04='$b04',d05='$b05',d06='$b06',d07='$b07',d08='$b08',d09='$b09',d10='$b10',e01='$b01',e02='$b02',e03='$b03',e04='$b04',e05='$b05',e06='$b06',e07='$b07',e08='$b08',e09='$b09',e10='$b10',f01='$b01',f02='$b02',f03='$b03',f04='$b04',f05='$b05',f06='$b06',f07='$b07',f08='$b08',f09='$b09',f10='$b010',g01='$b01',g02='$b02',g03='$b03',g04='$b04',g05='$b05',g06='$b06',g07='$b07',g08='$b08',g09='$b09',g10='$b10',cod_ficha='',objetivo='$bobjetivo',inicio='$inicio',fim='$fim',personal='$personal',nome_ficha='$nome_ficha',data_cad='$data_cad',cod_ficha='$cod_ficha'";echo $edit;mysqli_query($conn,$edit);//Fechando a conexao do banco de dados mysqli_close($conn);echo "<script>alert('EDIÇÃO EFETUADO COM SUCESSO');window.location='tela_principal.php';</script>";?>
  3. Eu estou com uma duvida! O que acontece e que estou fazendo um programa onde gerencia ficha de exercícios, Info. corporal etc... E a duvida que eu tenho e como eu faço para um usuário só veja o que ele cadastrou,alterou e excluiu e que consulte aquilo que ele fez! Só falta isso para acabar!
  4. o erro e assim: Você preenche os dados, você vai e aperta em cadastrar... OK! Ae dar um aviso, "CADASTRO EFETUADO COM SUCESSO". Correto? na hora que vou consultar no banco de dados, mais não existe dados, apenas os campos vazio! Mais o insert disse que foi feito!
  5. Estou com um problema aqui no meu código, e não estou conseguindo resolver! Esse e o HTML! <html><head><title> FICHA DA DIETA </title></head><body><body background="img/indexx.jpg"><h1 align="center" style="color:#FFF">CADASTRAR DIETA</h1><form action="dieta.php" method="post"><div align="center"><font size="4" face="Arial Black, Gadget, sans-serif" color="#FFFFFF">DATA DE CADASTRO:<input name="dat_cad" type="date" max="10" size="10" maxlength="6"></font><br /><br /><font size="4" face="Arial Black, Gadget, sans-serif" color="#FFFFFF">NOME DIETA:<input name="nome" type="name" max="10" size="10" maxlength="6"></font><font size="4" face="Arial Black, Gadget, sans-serif" color="#FFFFFF">OBJETIVO:<input name="objetivo" type="text" maxlength="20"></font><br /><font size="4" face="Arial Black, Gadget, sans-serif" color="#FFFFFF">INICIO DA DIETA:<input name="inicio" type="date" max="10" size="10" maxlength="6"></font><font size="4" face="Arial Black, Gadget, sans-serif" color="#FFFFFF">TERMINO DA DIETA:<input name="fim" type="date" max="10" size="10" maxlength="6"></font><br /> <br/></div><div align="center"><table width="562" border="1"><tr><td width="180" align="center"><font size="4" color="#FFFFFF" face="Arial Black, Gadget, sans-serif">SEGUNDA-FEIRA</font></td></tr><tr><td><input name="ref_1" type="text" size="30" /><input type="time" name="hora_1" /></td></tr><tr><td><input name="ref_2" type="text" size="30" /><input type="time" name="hora_2" /></td></tr><tr><td><input name="ref_3" type="text" size="30" /><input type="time" name="hora_3" /></td></tr><tr><td><input name="ref_4" type="text" size="30" /><input type="time" name="hora_4" /></td></tr><tr><td><input name="ref_5" type="text" size="30" /><input type="time" name="hora_5" /></td></tr><tr><td><input name="ref_6" type="text" size="30" /><input type="time" name="hora_6" /></td></tr><tr><td><input name="re_7" type="text" size="30" /><input type="time" name="hora_7" /></td></tr><tr><td><input name="ref_8" type="text" size="30" /><input type="time" name="hora_8" /></td></tr><tr><td><input name="ref_9" type="text" size="30" /><input type="time" name="hora_9" /></td></tr><tr><td><input name="ref_10" type="text" size="30" /><input type="time" name="hora_10" /></td></tr></table></div><div align="center"><input type="submit" value="CADASTRAR" /><input type="time" name="hora_1" /> <input type="reset" value="LIMPAR" /><input type="time" name="hora_1" /></div></form></body></html> Esse e o PHP! <?php//conexao$conn = mysqli_connect("*******","********","*******","*******")or die("Erro:" .mysqli_error($conn));//Recebendo informacoes do formulario$ref_1 = $_POST['ref_1'];$ref_2 = $_POST['ref_2'];$ref_3 = $_POST['ref_3'];$ref_4 = $_POST['ref_4'];$ref_5 = $_POST['ref_5'];$ref_6 = $_POST['ref_6'];$ref_7 = $_POST['ref_7'];$ref_8 = $_POST ['ref_8'];$ref_9 = $_POST ['ref_9'];$ref_10 = $_POST ['ref_10'];$hora_1 = $_POST['hora_1'];$hora_2 = $_POST['hora_2'];$hora_3 = $_POST['hora_3'];$hora_4 = $_POST['hora_4'];$hora_5 = $_POST['hora_5'];$hora_6 = $_POST['hora_6'];$hora_7 = $_POST['hora_7'];$hora_8 = $_POST ['hora_8'];$hora_9 = $_POST ['hora_9'];$hoa_10 = $_POST ['hoa_10'];$ob = $_POST['objetivo'];$in = $_POST['inicio'];$fim = $_POST['fim'];$per = $_POST['personal'];$nome_ficha= $_POST['nome_ficha'];$data_cadastro= $_POST['data_cad'];//Efetuar a inclusao $inc_dados = "insert into dieta (ref_1,ref_2,ref_3,ref_4 ,ref_5,ref_6,ref_7,ref_8,ref_9,ref_10,hora_1,hora_2,hora_3,hora_4 ,hora_5,hora_6,hora_7,hora_8,hora_9,hora_10,objetivo,inicio,fim,personal,nome_ficha,data_cad) values ('$ref_1','$ref_2','$ref_3','$ref_4 ','$ref_5','$ref_6','$ref_7','$ref_8','$ref_9','$ref_10','$hora_1','$hora_2','$hora_3','$hora_4 ','$hora_5','$hora_6','$hora_7','$hora_8','$hora_9','$hora_10','$ob','$in','$fim','$per','$nome_ficha','$data_cad')";mysqli_query($conn,$inc_dados);//Fechando a conexao do banco de dadosmysqli_close($conn);echo "<script>alert('CADASTRO EFETUADO COM SUCESSO');window.location='tela_principal.php';</script>";?>

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...