What are the potential drawbacks of storing images as BLOB in a MySQL database?

Storing images as BLOB in a MySQL database can lead to slower database performance, increased storage space usage, and difficulties in managing and retrieving the images. It is generally recommended to store images in a file system and store the file path in the database instead.

// Example of storing image in file system and saving file path in database
$image = $_FILES['image']['tmp_name'];
$target_dir = "uploads/";
$target_file = $target_dir . basename($_FILES["image"]["name"]);

move_uploaded_file($image, $target_file);

// Save file path in database
$sql = "INSERT INTO images (image_path) VALUES ('$target_file')";
mysqli_query($conn, $sql);