我厌倦了试图看看出了什么问题。我有两个 php。从第一个开始,我将变量“select1”(基本上是 id)发送到第二个,然后我想更新上传 pdf 文件的记录。
$id = "-1";
if (isset($_GET['select1'])) {
$id = mysql_real_escape_string($_GET['select1']);
}
if(isset($_POST['Submit'])) {
$my_upload->the_temp_file = $_FILES['upload']['tmp_name'];
$my_upload->the_file = $_FILES['upload']['name'];
$my_upload->http_error = $_FILES['upload']['error'];
if ($my_upload->upload()) { // new name is an additional filename information, use this to rename the uploaded file
mysql_query(sprintf("UPDATE sarcini1 SET file_name = '%s' WHERE id_sarcina = '%s'", $my_upload->file_copy, $id));
}
}
如果我输入带有有效 id 的行,例如:
$id = 14;
这是工作。我做错了什么?谢谢!