新しい製品の編集、表示、削除、および追加に使用できる php ファイルが必要です。新しい製品のパーツの表示と追加は完了しましたが、今やろうとしているのは、データベース情報を含むテーブルを表示するときに、新しいアイテムを編集、削除、および追加するためのボタンがあることです。ボタンに追加したいコードは次のとおりです。
<html>
<head>
<style type="text/css">
td
{
padding:15px;
}
</style>
</head>
<?php
$mysqli = new mysqli("localhost","herp","lerp","derp");
$search=$_POST['search'];
$searchoption=$_POST['searchoption'];
$query= "SELECT * FROM contacts WHERE $searchoption = '".$search."'";
$result = $mysqli->query($query);
if (!$result) {
printf("Query failed: %s\n", $mysqli->error);
exit;
}
?>
<table>
<th> Information</th>
<?php
while ($contact = $result ->fetch_assoc()) {
echo "<tr>";
echo "<th> Item Number </th>";
echo "<th> Item Name </th>";
echo "<th> Description </th>";
echo "<th> Inventory </th>";
echo "<th> Price </th>";
echo "<th> Active or Non-Active </th>";
echo "<th> Photo </th>";
echo "</tr>";
echo "<tr>";
echo "<td>".$contact['item_number']."</td>";
echo "<td>".$contact['item_name']."</td>";
echo "<td>".$contact['item_description']."</td>";
echo "<td>".$contact['item_inventory']."</td>";
echo "<td>".$contact['item_price']."</td>";
echo "<td>".$contact['item_active_or_nonactive']."</td>";
echo "<td>".$contact['item_photo']."</td>";
echo "</tr><br/>";
}
?>
</table>
</html>
私の質問が十分に具体的でない場合は、私に知らせてください.損失。