How to pass data from one table to another in php?

2

I'm new to programming, and I'm developing an advertising site. And I have difficulties, in my the person has the option to publish a advertisement of it. It publishes and is sent to the database, and in the control panel I put it to show the advertisement information, and it is at this time that I need help.

When the advertisement is ok, I wanted to put a button: "Publish" and would send that data to another table.

How do I display the account information on the Dashboard:

<table border="1" width="100%" cellspacing="0" cellpadding="0" height="20" bordercolor="#C0C0C0">
<tr>
<td width="50%"><h3>Descrição</h3></td>
<td width="20%"><h3>Site</h3></td>
<td width="10%"><h3>Edita</h3></td>
<td width="5%"><h3>Deleta</h3></td>
</tr>
<?php
include ("conexao.php");
$sql="select * from principal";
$res= mysql_query ($sql);
while ($dados=mysql_fetch_array($res)){
{
    echo "<tr><td>".$dados['descricaolink'];
    echo "<td>".$dados['sitelink'];
    echo "<td><a href='edita_divulgalink.php?codigo=$dados[idlink]'><img src='img/editar.png'></a>";
    echo "<td><a href='deleta_divulgalink.php?codigo=$dados[idlink]'><img width='24' height='24' src='img/deletar.png'></a></tr>";
?>
</table>

Before editing I wanted to put a Publish that when clicking it was going to send those data that I am getting to another table. Can someone help me?

    
asked by anonymous 16.01.2015 / 22:25

1 answer

-1

What you are trying to do is not right, the most sure thing to do is how the above friend told you to create a field in the named named boolean bank that by default in your case there I understood what should start with value false, and clicking the publish button is updated to true.

select * from propagandas where now() > data_inicio and now() < data_fim 

This select if you have a publishing range date

select * from propagandas where now() > data_inicio and now() < data_fim and publicado = true

or even better this way that verifies if the publication is within the period of publication and if it is actually published because it can ta within the time limit but not published

    
17.01.2015 / 03:48