2
I’m new to programming, and I’m developing an advertising website. And I’m struggling, in my person has the option to publish an advertisement of her. It publishes and is sent to the database, and on the control panel I put to show the advertising information, and this is when I need help.
When the advertisement is ok, I wanted to put a button: "Publish" and would send that data to another table.
How I show account information in 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 would send that data I’m getting to another table. Someone can help me?
possible duplicate of How to copy column data from one table to another table
– Lollipop
Didn’t help me :/
– Mateuslapa
If really need copy to a separate table, it is probably the case to create a page and access with
publica_divulgalink.php?codigo=$dados[idlink]
using the same logic. On this page, you can use a query like Insert .. select with IDunique
if the tables are of the same DB, and if they are different Dbs, do aselect
in PHP, followed by ainsert
orreplace
with the data collected.– Bacco
@Mateuslapa when you say copy the table, is in the browser, that is, the HTML table or is in the database?
– Gê Bender