Ir para conteúdo
Fórum Script Brasil

designerph

Membros
  • Total de itens

    2
  • Registro em

  • Última visita

Sobre designerph

designerph's Achievements

0

Reputação

  1. Estou seguindo seu tutorial amigo, muito bem explicado, parabéns! http://rberaldo.com.br/como-atualizar-php-mysql-mysqli/
  2. Eu gostaria que cada valor em minha tabela html/php tivesse um switcher(checkbox) on/off padrão de seleção que quando eu mudar o valor, ele mantém dessa forma, mesmo quando estou acessando ou saindo da minha página.. minha tabela: <table> <tr> <th>ID</th> <th>Cliente</th> <th>Serviço</th> <th>Material</th> <th>Detalhes</th> <th>Observações</th> <th>STATUS</th> <th>Opções</th> </tr> <?php include "connect.php"; $i = "select * from tbl_student"; $h = mysql_query($i); while($tr=mysql_fetch_array($h)) { ?> <tr> <td><?php echo $tr[0]; ?></td> <td><?php echo $tr[1]; ?></td> <td><?php echo $tr[2]; ?></td> <td><?php echo $tr[3]; ?></td> <td><?php echo $tr[4]; ?></td> <td><?php echo $tr[5]; ?></td> <td><?php echo $tr[6]; ?></td> <td align="center"><a href="Delete_Form.php? txtid=<?php echo $tr[0];?>">Delete</a> / <a href="Edit_Form.php? txtid=<?php echo $tr[0];?>">Edit</a> </td> </tr> <?php } ?> </table> meu add-row.php <?php $id = $_POST['txtid']; $cliente = trim($_POST['txtcliente']); $servico = trim($_POST['txtservico']); $material = trim($_POST['txtmaterial']); $detalhes = trim($_POST['txtdetalhes']); $observacoes = trim($_POST['txtobservacoes']); $date = trim($_POST['txtdate']); if(isset($_POST['cmdadd'])){ if(empty($cliente) || $material=="Material" || $_POST['txtday']=="Day" || $_POST['txtmonth']=="Month" || $_POST['txtyear']=="Year" || empty($detalhes) || $subject=="Select Subject") { echo "<center>Sorry please input data</center>"; }else{ include "connect.php"; $i = mysql_query("insert into tbl_student values('".$id."','".$cliente."','".$servico."','".$material."','".$detalhes."','".$observacoes."','".$date."')"); if($i==true){ echo '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php">'; } //if($i==true){ //header('Location:index.php'); //exit; //mysql_close(); //} } } ?> e meu sql database: CREATE TABLE IF NOT EXISTS `tbl_student` ( `id` int(10) NOT NULL, `cliente` varchar(50) NOT NULL, `servico` varchar(10) NOT NULL, `material` varchar(50) NOT NULL, `detalhes` varchar(50) NOT NULL, `observacoes` varchar(50) NOT NULL, `date` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; Estou seguindo este tutorial, mas não consigo aplicar nos meus códigos atuais que estão funcionando perfeitamente para inserir, editar ou deletar os valores, gostaria apenas de acrescentar este sistema de switch on/off para cada valor adicionado. http://www.freezecoders.com/2013/05/store-value-from-onoff-button-in-mysql-database-using-php-ajax.html
×
×
  • Criar Novo...