将图像存储在文件系统中并使用mysql进行索引 [英] Store images in file system and use mysql to index

查看:107
本文介绍了将图像存储在文件系统中并使用mysql进行索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是MySQL的新手.我有一个网站,它将检索并允许用户将照片上传到该网站.我将照片存储为文件夹调用\users\images中的文件系统.如何使用文件系统从MySQL调用照片?我知道人们谈论有意义的索引,但不确定如何编写索引.如果有人举一个例子或为我提供了一种解决方案,可以使用文件系统存储照片并在每次用户登录到我的网站时将其显示在网络上.

I am sort of a newbie with MySQL. I have a website that will retrieve and allow user to upload photos to the website. I am going to store the photos as a file system inside a folder call \users\images. How would I call the photos from the MySQL using file system? I know people talk about index which make sense but not sure how to code it. If someone has an example or provide me a solution to store photos using file system and display it on the web for each user login to my website.

推荐答案

将图像文件保存在\ users \ images位置,并将带有文件名的路径保存在mysql表中.

Save the image files in \users\images location and save path with filename in mysql table.

所需的数据类型应该是可以接受字符串的数据类型,例如VARCHAR.

The datatype needed would be one that accepts strings, such as VARCHAR for example.

这里是对其他类型的引用:

Here is a reference to other types:

这篇关于将图像存储在文件系统中并使用mysql进行索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆