【发布时间】:2013-11-26 12:55:21
【问题描述】:
当我运行以下代码时,图像被移动到所需的文件夹,但没有任何内容保存在数据库中。如何将图像的名称保存在数据库中。请帮忙...
mysqli_query($con,"INSERT INTO blog (title, image, content)
VALUES ('$_POST[title]','$_POST[image]','$_POST[content]')");
$target_Path = "uploaded/";
$target_Path = $target_Path.basename( $_FILES['image']['name'] );
move_uploaded_file( $_FILES['image']['tmp_name'], $target_Path );
【问题讨论】:
-
不是真的,他想把那个图像放在那里。 ;)
-
... 因为您没有包含该列的值?代码中倒数第二行引用图像名称。你为什么不尝试使用它?
标签: php mysql database image upload