PHP Classes

Using PHP 7 Insert image in the MySQL database and display: Insert image in a MySQL database

Recommend this page to a friend!
  All requests RSS feed  >  Using PHP 7 Insert image in the MySQL...  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

Using PHP 7 Insert image in the MySQL database and display

A request is featured when there is no good recommended package on the site when it is posted. Edit

Picture of Vicente Paulo Maciel by Vicente Paulo Maciel - 8 years ago (2015-12-26)

Insert image in a MySQL database

This request is clear and relevant.
This request is not clear or is not relevant.

+4

I want to use PHP 7 and insert an image in a MySQL database, as well and display image in the browser.

  • 3 Clarification requests
  • 3. Picture of Arash. Ataei by Arash. Ataei - 8 years ago (2016-01-20) Reply

    you can use blob data entry in mysql, and after that, using connection claass with an INSERT (<code>insert into ?table.?db () values() </code>).

    • 2. Picture of Arash. Ataei by Arash. Ataei - 8 years ago (2016-01-20) Reply

      ertreterterterterter

      • 1. Picture of Manuel Lemos by Manuel Lemos - 8 years ago (2016-01-19) Reply

        There are several classes for inserting images in databases but they use the old MySQL extension.

        What you may do is to use one of those classes and then use Dave Smith MySQL to MySQLi wrapper class, so mysql calls are mapped to mysqli calls.

        Ask clarification

        2 Recommendations

        Handle Binary Files With PDO: Save and load binary files in databases using PDO

        This recommendation solves the problem.
        This recommendation does not solve the problem.

        0

        Picture of zinsou A.A.E.Moïse by zinsou A.A.E.Moïse package author package author Reputation 5840 - 6 years ago (2017-11-10) Comment

        try this


        Image Embedder: Replace images with embedded data in HTML pages

        This recommendation solves the problem.
        This recommendation does not solve the problem.

        0

        Picture of Karl Holz by Karl Holz package author package author Reputation 120 - 7 years ago (2016-07-07) Comment

        take a look at my Image Embedder class, it might be what you're looking for; I designed it to embed images into html using base64 encoding. Take a look at the 'img_fixer.php' code near the 'base64_encode_image ' function and you'll get an idea of how you could solve this problem for storing your image data in a normal text field.

        Now depending on how you want to retrieve, you can always send the header for your images MIME type and print the decoded Base64 data that you queried, then exit the script for that image; or you can embed it into your document with something like <img src="data:Image/[gif, jpg or png];base64,[base64_encodeed image string]" /> for each image -- this is most ideal for smaller images though.


        Recommend package
        : 
        :