Such as this :
How do I save images like the format as the above URL ?
If you need to download the image from the web, you will need to send a request to the URL where the image is located. In PHP you can download an image like this:
file_get_contents($url);
or you could load it from a local file:
Assuming PHP and MySQL you can do it like this:
$sql = "INSERT INTO products(product_name, price, product_image) VALUES (:product_name, :price, :product_image)"; foreach ($products as $product) { $stmt = $pdo->prepare($sql); $stmt->execute($product); }
Example taken from https://www.digitalocean.com/community/tutorials/how-to-use-the-mysql-blob-data-type-to-store-images-with-php-on-ubuntu-18-04
Getting the image
If you need to download the image from the web, you will need to send a request to the URL where the image is located. In PHP you can download an image like this:
or you could load it from a local file:
Storing it
Assuming PHP and MySQL you can do it like this:
Example taken from https://www.digitalocean.com/community/tutorials/how-to-use-the-mysql-blob-data-type-to-store-images-with-php-on-ubuntu-18-04