hello, i have a probelm where i want to update my image in database using unlink(). The error is Warning: unlink(images/481933.jpg): No such file or directory. I try search the solution but nothing can solve my probelm. anyone can help me? thank you in advanced. this is my code:
$upload_dir='images/';
$imgExt=strtolower(pathinfo($images,PATHINFO_EXTENSION));
$valid_extensions=array('jpeg', 'jpg', 'png', 'gif', 'pdf');
$picProfile=rand(1000, 1000000).".".$imgExt;
unlink($upload_dir.$edit_row['prod_img']);
move_uploaded_file($tmp_dir, $upload_dir.$picProfile);
$stmt=$db_conn->prepare('UPDATE product SET prod_name=:prod_name, category=:category, prod_img=:prod_img, unit_price=:price, stock=:stock, min_limit=:min_limit, weight=:weight, description=:description, packaging=:packaging, size=:size, retail_price=:retail, agent_price=:agent WHERE prod_id=:prod_id');