开发者

Image management using MySQL and image directory

A friend of mine told me that saving images in the database is not much of a good idea. Instead save it to the directory and then save it's name in the database and when I want to display the images in the 开发者_开发技巧browser I'm just going to use the name in the database to find the picture. Can anyone please guide me on how to do this starting from scratch? Any help would be much appreciated.

By the way I am using php and MySQL.


Do two things:

  • accept more answers, here's how: https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work
  • read this tutorial: http://articles.sitepoint.com/article/php-gallery-system-minutes


What is it exactly that you don't know how to do? Your question seems to contain its own answer:

  1. set up a directory for images, accessible to your web server
  2. copy some image files in there
  3. go to phpmyadmin and create a table with a filename field, for example of type varchar 100
  4. store the image filenames in the table
  5. write a php script that fetches image names and displays the HTML to load the images
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜