开发者

how to insert an image into a database using php [duplicate]

开发者 https://www.devze.com 2023-02-20 00:04 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicates: Inserting images into a database
This question already has answers here: Closed 11 years ago.

Possible Duplicates:

Inserting images into a database

Store images in database or 开发者_StackOverflow中文版on file system

Hi,

I want to insert product image to database using php. please help me out.


Are you sure you really want to store images in the database? Its faster to upload the image to the file system and store its location in the database, faster in both upload and accessing.

If however it is storing images as binary in the DB for security for example:

Google Has Many Answers

Like:

Tutorial Storing Images MySQL PHP


There are two ways to do this.

  1. Insert Binary data for the image.
  2. Insert location of image into database and keep image file at a place accessible by your application.
0

精彩评论

暂无评论...
验证码 换一张
取 消