使用PHP将图像从一个文件移动到另一个文件

时间:2018-09-03 18:43:00

标签: php mysql

我正在尝试创建一个允许管理员接受或拒绝图像的按钮。当管理员接受它将图像从unimages移到images文件夹时,数据库代码正在运行,但是我仍然无法将图像移至另一个文件夹。

$db = mysqli_connect("localhost", "root", "", "drawingguide");


$id=$_GET["id"];
 $accept = mysqli_query($db, "SELECT * FROM verify WHERE id=$id");
 mysqli_query($db, "INSERT INTO images SELECT NULL,un_image, un_category FROM 
 verify WHERE un_id=$id");
 rename("unimages/$accept[un_image]", "images/$accept[un_image]");
 $reject= mysqli_query($db, "SELECT * FROM verify WHERE un_id = $id");
 $delete = mysqli_fetch_array($reject);



 mysqli_query($db, "DELETE FROM verify WHERE un_id = $id");

0 个答案:

没有答案