インベントリ プログラムに取り組んでおり、次の点について助けが必要です: データベースからデータを選択し、これをテーブルに表示することで機能するテーブルがあります。ユーザーがフォームから不良/欠陥のあるレコードを削除できるようにする必要があります(もちろん、レコードを削除するために毎回データベース自体にアクセスする必要はありません。愚かです)
私のコード:
<div id="artikel-container">
<table class="table 1">
<thead>
<title>Inventory Grid.html</title>
<meta charset = "UTF-8" />
<style type = "text/css">
table, td, th {
border: 1px solid black;
}
</style>
</thead>
<tbody>
<?php
$con = mysqli_connect("localhost", "root", "admin", "inventarisdb");
// Check connection
if ( mysqli_connect_errno() ) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query( $con, "SELECT * FROM BCD" );
echo "<table border='0'>
<tr>
<th>Categorie</th>
<th>SerieNummer</th>
<th>MacAdress</th>
<th>ProductCode</th>
<th>Prijs</th>
<th>RekNummer</th>
<th>PaletNummer</th>
<th>Hoeveelheid</th>
<th>Aantekeningen/th>
</tr>";
while( $row = mysqli_fetch_array( $result ) ) {
echo "<tr>";
echo "<td>" . $row['Categorie'] . "</td>";
echo "<td>" . $row['SerieNummer'] . "</td>";
echo "<td>" . $row['MacAdress'] . "</td>";
echo "<td>" . $row['ProductCode'] . "</td>";
echo "<td>" . $row['Prijs'] . "</td>";
echo "<td>" . $row['RekNummer'] . "</td>";
echo "<td>" . $row['PaletNummer'] . "</td>";
echo "<td>" . $row['Hoeveelheid'] . "</td>";
echo "<td>" . $row['Aantekeningen'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
</article>
</fieldset>
</tbody>
このコードは完全に機能します。
私が達成したいのは、チェックボを使用してこのテーブルからレコードを選択し、次のようにプログラムされたページの下部にある削除ボタンをクリックして削除することです。
<Input type="submit" id="submit" name="submit" value="Verwijderen" />
または、少なくともこの原則で!
(これは私が書いた 2 番目のアプリケーションです。1 番目は Web ページで、これを調査する方法がわかりません。私が必要としているものではない質問や投稿を見つけ続けています :S U が私を助けてくれることを願っています)