Storing Image In MySQL Database Using PHP

Pensu

Pensu

@pensu-8tNeGU • Oct 21, 2024

Hi ppl

I want to store a image on database and i am using php to upload and retrieve the data and MySql. I dont have any idea how to proceed. Can anyone throw some light on it.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Oct 22, 2011

    You can use following approach

    1:- Create a button to upload image , (Just a simple file tag)

    Now your image will be saved in following path say (/upload/)

    Now all you need is to save this image path in database and access it whenever you want or as an alternative you can use blob datatype to store image (I have never worked on this , just have little knowledge)

  • The_Small_k

    The_Small_k

    @the-small-k Oct 22, 2011

    Use streams to upload any file and store them into sql using blob database.

  • Pensu

    Pensu

    @pensu-8tNeGU Oct 22, 2011

    I was having some problem in retrieving the image but its done now. Thank guys for your help....😀