i am having issues with the query below its showing success with no error but not inserting to the database
here is my code
public function uploadImg($table, $imageurl){
//path to tore the uploaded images
$target = "../images/" .basename($_FILES['image']['name']);
$image = $_FILES['image']['name'];
//echo $target;
$sql = "INSERT INTO {$table} ($imageurl) values('$target')";
$q = $this->DBcon->prepare($sql);
$q->execute();
if(move_uploaded_file($_FILES['image']['tmp_name'], $target)){
echo "uploaded successfully";
}else{
echo "error uploading";
}
}
}