我已经尝试了我能找到的每一个例子来使这个工作正常,但没有成功。看起来很简单,如果$number
不是跟踪行中的值,我想要的只是一个错误。
<?php
mysql_connect("localhost", "user", "pass") or die("Connection Failed");
mysql_select_db("mydb") or die("Connection Failed");
$number = $_POST['number'];
$date = $_POST['datechange'];
$removed = $_POST['remover'];
$query = "UPDATE Custody SET DateOut = '$date' ,RemovedBy = '$removed' WHERE Tracking= '$number'";
if (mysql_query($query)) {
echo "updated";
} else {
echo "fail";
}
?>