我在頁面上有一個表單,它向我想要顯示該記錄的頁面發佈記錄ID。形式是:顯示MySQL記錄
<form method="post" action="update.php">
<input type="hidden" name="sel_record" value="$id">
<input type="submit" name="update" value="Update this Order">
</form>
我已經測試,看看$ id是否得到正確的值,它確實。當它發佈到update.php時,它不會返回任何值。有任何想法嗎?這裏是更新頁面代碼:
$sel_record = $_POST['sel_record'];
$result = mysql_query("SELECT * FROM `order` WHERE `id` = '$sel_record'") or die (mysql_error());
if (!$result) {
print "Something has gone wrong!";
} else {
while ($record = mysql_fetch_array($result)) {
$id = $record['id'];
$firstName = $record['firstName'];
$lastName = $record['lastName'];
$division = $record['division'];
$phone = $record['phone'];
$email = $record['email'];
$itemType = $record['itemType'];
$job = $record['jobDescription'];
$uploads = $record['file'];
$dateNeeded = $record['dateNeeded'];
$quantity = $record['quantity'];
$orderNumber = $record['orderNumber'];
}
}
男孩,我知道我是一個新手,但我真的很笨!謝謝 – Michael
沒有什麼大不了的人類犯錯誤,歡迎您 –
如果是這個問題,那麼donot忘記upvote並標記爲已解決謝謝 –