duangao7133 2019-04-27 23:06
浏览 71

mysql - 通过操作将行从一个表移动到另一个表

is it possible to move a table row to another table row while clicking on a button? I already have 2 buttons for Edit.php and Delete.php. But now I want to add a button to move this row to another table.

This information comes from table "offers"

<tr>
<th class='no-index' scope='row'>".$row['id']."</th>
<td>".$row['name']."</td>
<td>".$row['tel']."</td>
<td>".$row['email']."</td>
<td>".$row['phone']."</td>
<td><a class='pdf' href='download.php?client=".$row['id']."' role='button'> 
</a></td>
<td><a class='btn-success btn-primary btn-sm' href='edit.php? 
client=".$row['id']."' role='button'>Edit</a></td>
<td><a class='btn-danger btn-primary btn-sm' href='delete.php? 
id=".$row['id']."' role='button'>X</a></td>
</tr>

This information comes from table "urgent"

<tr>
<th class='no-index' scope='row'>".$row['id']."</th>
<td>".$row['name']."</td>
<td>".$row['tel']."</td>
<td>".$row['email']."</td>
<td>".$row['phone']."</td>
<td><a class='pdf' href='download.php?client=".$row['id']."' role='button'> 
</a></td>
<td><a class='btn-success btn-primary btn-sm' href='edit.php? 
client=".$row['id']."' role='button'>Edit</a></td>
<td><a class='btn-danger btn-primary btn-sm' href='delete.php? 
id=".$row['id']."' role='button'>X</a></td>
</tr>

I have the following:

INSERT INTO urgent SELECT * FROM offers WHERE id = $id;
DELETE FROM offerts WHERE id = $id;

How can I run this sql with a buttonclick and add it below the edit and delete button?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?
    • ¥15 matlab(相关搜索:紧聚焦)
    • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计