所以我有一个从 SQL 数据生成的表,我希望能够从表中编辑该数据,而无需转到单独的表单。我希望用户能够选择表格的任何部分并进行更改。这是可能的还是必须使用单独的表格来完成?目前我有这个只显示表格:
<?php
$con=mysqli_connect("localhost","root","","db_test");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM tbl_products");
echo "<table border='1'>
<tr>
<th>Products:</th>
<th>Price:</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td><a href=\"product.php?id=". $row['product_id'] ."\">" . $row['product_name'] . "</a></td>";
echo "<td>" . $row['product_price'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>