php - 使 PHP 脚本可编辑并从 SQL 表中提取数据
问题描述
我已经在 HTML 中创建了表格并使用在线工具将其转换为 PHP。以下是表格的部分编码和图像。现在我想让文本框可编辑并显示 sql 表中的数据。我怎样才能做到这一点?
print " <td class=\"tg-7btt\">U</td>\n";
print " <td class=\"tg-fymr\"><W/td>\n";
print " <td class=\"tg-fymr\">X</td>\n";
print " <td class=\"tg-fymr\">Y</td>\n";
print " <td class=\"tg-fymr\">Z</td>\n";
print " </tr>\n";
print " <tr>\n";
print " <td class=\"tg-fymr\">Planned Execution Metrics</td>\n";
print " <td class=\"tg-c3ow\" colspan=\"5\"></td>\n";
print " </tr>\n";
print " <tr>\n";
print " <td class=\"tg-0pky\">Total planned Test Cases</td>\n";
print " <td class=\"tg-c3ow\"></td>\n";
print " <td class=\"tg-0pky\"></td>\n";
print " <td class=\"tg-0pky\"></td>\n";
print " <td class=\"tg-0pky\"></td>\n";
print " <td class=\"tg-0pky\"></td>\n";
print " </tr>\n";
解决方案
为什么需要文本框,您可以直接从下面的代码中完成
<div class="tables">
<table class="table"> <thead> <tr> <th>Id</th> <th>Message</th> <th>Date</th> <th>Exipry date</th> <th> Actions </th> <th>   </th> </tr> </thead>
<tbody>
<?php
$sql="select * from notice";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result))
{
echo "<tr class='active'>
<td>".$row[0]."</td>
<td>".$row[1]."</td>
<td>".$row[2]."</td>
<td>".$row[3]."</td>
</tr>";
}
?>
推荐阅读
- seaborn - Pearson 相关返回 nan 相关
- typescript - Angular 8 window.open 更改窗口的名称
- javascript - 内容脚本的多个 .js 文件不起作用
- linux - 如何正确设置 Gitlab gitlab-ci 变量
- office-js - 加载功能区或创建或打开文档时启动任务窗格
- r - 如何根据另一个以日期为条件的 df 在 r 中创建新的 df?
- java - 循环中 Rest API 调用的 Vertx 列表
- c - 结构在汇编中是如何组织的?
- redirect - 如果在请求中找到字符串,haproxy 重定向到新域,但保留并发送所有 URL 参数
- python - 我不知道如何处理这个 python 错误 TypeError: 'tuple' object is not callable