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

Im trying to make a button that allow admin to accept or reject a image. When admin accept it move the image from unimages to images folder, the database code is working but I still can't move the image to another folder.

$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");