私はURLの最後にセルの値を持ってきて、MYSQLテーブルから目的の行をそれぞれ削除しようとしています。ただし、$row['waybill_ID']
の値は期待どおりに反映されません。これを改善するために私は何ができますか?私はこれが少し引き出されていることを理解していますが、私はこれを「あなたは確信していますか?PHP echo MYSQLの値をURLに
<html>
<body>
<div id="myNav" class="overlay">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×
</a>
<div class="overlay-content">
<h2 style="color: white">Are you sure you want to delete this record?</h2>
<h2 style="color: white">This record will no longer exist after
deletion</h2>
<a id="deletePrompt" href="#" target="blank">Delete Record</a>
</div>
</div>
<div class="midA">
<div class='wrapper'>
<button class="accordion">Unit(s) and Driver(s)</button>
<div class="panel">
<div class='buffer'>
<?php
//Unitboard Display
$issue_ID = $_GET['idx'];
$mysqli = new mysqli('localhost', 'root', '', 'disolDemo');
$query = $mysqli->query("SELECT * FROM unitboard WHERE issue_ID = '$issue_ID'") or die($msqli->error);
echo"
<table border= 1px solid white>
<tr>
<th>Action</th>
<th>Waybill_ID</th>
<th>Driver</th>
<th>Unit Type</th>
<th>Move Type</th>
<th>Route ID</th>
<th>Tractor Number</th>
<th>Trailer Number</th>
<th>Waybill Status</th>
</tr>
<tr>";?><?php
while($row = mysqli_fetch_assoc($query)){?>
<td>
<a href="#" onclick="window.open('editUnitBoard.php?idx=<?php echo $row['waybill_ID'] ?>', 'name', 'location=no,scrollbars=yes,status=no,toolbar=no,resizable=no')">edit</a>
<a href="#" onclick="openNav()">delete</a>
</td>
<?php echo"
<td>{$row['waybill_ID']}</td>
<td>{$row['driver']}</td>
<td>{$row['unitType']}</td>
<td>{$row['moveType']}</td>
<td>{$row['location_ID']}</td>
<td>{$row['tractorNum']}</td>
<td>{$row['trailerNum']}</td>
<td>{$row['waybillStatus']}</td>
</tr>";
}
echo'<table></table>';
?>
<button style="margin-top: 15px; float: right" class='button' type="button" a href="#" onclick="window.open('formNewUnit.php?idx=<?php echo $_GET['idx'] ?>', 'name', 'location=no,scrollbars=yes,status=no,toolbar=no,resizable=no')">Create New Unit</button>
<a href="viewRun.php?idx=<?php echo $_GET['idx'] ?>" target="_blank">view</a>
<div style="clear: both;"></div>
</div>
</div>
</div>
</div>
<script>
function openNav() {
document.getElementById("myNav").style.width = "100%";
document.getElementById("deletePrompt").href="editUnitBoard.php?idx=<?php
echo $row['waybill_ID']; ?>";
return false;
}
function closeNav() {
document.getElementById("myNav").style.width = "0%";
}
</script>
</body>
</html>
結果がeditUnitBoard.php?IDX =であるが、私は、これはIDを入力しますecho $値を使用して、列を選択し、助け
echo $ row ['waybill_ID'];おそらく?その行方不明。 PHPの終わりをオフにします。 – FreudianSlip
$ row – symcbean
を読み込むコードには何もありません。この値 '$ row ['waybill_ID']'をどこから取得していますか。 ?データベースからフェッチしていますか?そのPHPコードを貼り付けます。 – Raghav