Quantcast
Channel: Últimos conteúdos
Viewing all articles
Browse latest Browse all 14190

Inserir dados a partir de checkbox

$
0
0

Fala galera sou iniciante em PHP estou com uma pagina onde tenho dados retornados do banco de dados e gostaria de selecionar linha especificas a partir de um checkbox onde em seguida eu pudesse enviar para uma tabela do banco estes dados, segue o codigo e se alguem puder tirar a duvida fico muito grato.

 

<?php
require_once "../sessao.php";
$conexao = mysql_connect ("localhost","root","123456");
if ($conexao){
if(mysql_select_db("systec",$conexao)){
$query = "SELECT * FROM tab_palestra";
$rs = mysql_query($query);
echo "<table border = &nbsp\"1\" width=\400px\">
  <tr>
   <th>selecione</th>
   <th>titulo</th>
   <th>descricao</th>
   <th>autor</th>
   <th>email</th>
   <th>data</th>
   <th>horario</th>
           
   
</tr>";
while ($linha = mysql_fetch_array($rs)){
 
echo "<tr>";
echo "<td><input type='checkbox' name='palestra[]'</td>";
echo "<td>".$linha['titulo']."</td>";
echo "<td>".$linha['descricao']."</td>";
echo "<td>".$linha['autor']."</td>";
echo "<td>".$linha['email']."</td>";
echo "<td>".$linha['data']."</td>";
echo "<td>".$linha['horario']."</td>";
echo "</tr>";
 
 
}
echo "</table>";
}
 
 
}
$html = "
<html>
<head>
<title> SEMANA TECNOLOGICA</title>
<link href='../conf/tela.css' rel='stylesheet' media='all'>
</head>
<body>
<div class='sucess'>O usuario " .  $usuario . " esta logado.</div><br>
    <form action='#' method='POST'>
 
    </form>
 
 
<h5>&copy <a href=''></a><a href=''></a><a href='../logout.php'>Sair</a></h5></div>
</body>
</html>";
echo $html;
?>

Viewing all articles
Browse latest Browse all 14190