English 中文(简体)
网址上每个用户的图像(php)
原标题:Storing pictures per user on website (php)

Users of the website need to able to store images in their "area" , should I store these in the database directly or create a directory for each user. Or should I just have a single directory for all images and in the database store a list of images that each user owns? I m looking for the most effecient way, which I think is a folder for each user?

最佳回答

如果每个用户有多种照片,如用户制作的ava和彩色照片,那么就使用不同的盒子,其名称是用户id或用户id。

如果你只储存一台大型圆板,其图像名称是用户id或用户id。

问题回答

它取决于那里的情况有多少。

如果每个用户只有一幅照片,那么同一目录中可能都有一个照片。

然而,如果你有“书目”,那么所有用户的照片就可能有几百万份。 寻找工作将非常缓慢。 然后,我与每名用户的一组人在一起。

此外,从来没有直接接触过这些夹子。 利用你的数据库链接这些档案。

更好地使用夹或切身。 如果用户能上载大幅图像,你也可以将功能转作图像。 你的文字将设法创造不同的规模,如ava印。 此外,还收集这些图像。 So thumbnail 或avatar 观众只看看原始形象的切身形象。 大型形象对于未来工作来说是有用的,就像对ava的更大预测一样。





相关问题
what is wrong with this mysql code

$db_user="root"; $db_host="localhost"; $db_password="root"; $db_name = "fayer"; $conn = mysqli_connect($db_host,$db_user,$db_password,$db_name) or die ("couldn t connect to server"); // perform query ...

Users asking for denormalized database

I am in the early stages of developing a database-driven system and the largest part of the system revolves around an inheritance type of relationship. There is a parent entity with about 10 columns ...

Easiest way to deal with sample data in Java web apps?

I m writing a Java web app in my free time to learn more about development. I m using the Stripes framework and eventually intend to use hibernate and MySQL For the moment, whilst creating the pages ...

join across databases with nhibernate

I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...

How can I know if such value exists in database? (ADO.NET)

For example, I have a table, and there is a column named Tags . I want to know if value programming exists in this column. How can I do this in ADO.NET? I did this: OleDbCommand cmd = new ...

Convert date to string upon saving a doctrine record

I m trying to migrate one of my PHP projects to Doctrine. I ve never used it before so there are a few things I don t understand. In my current code, I have a class similar to this: class ...

热门标签