将图像存储在文件系统中并使用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: