php - Questions about data table design?
大家讲道理
大家讲道理 2017-06-08 11:01:51
0
1
607

You need to design a table to store images, including the path to upload the image, and the description. Each icon has two images, one style before clicking and one style after clicking. How to design fields elegantly? Please give me some advice, thank you!

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
刘奇

This doesn’t need to be stored in the database, right? Just put the images you want to use on the server and then reference them through css

If you really want to save a database, let me give you the table structure for storing uploaded files in a project for reference:

Field Type Null Key Default Extra
id bigint(10) NO PRI NULL auto_increment
contenthash varchar(40) NO MUL
pathnamehash varchar(40) NO UNI
contextid bigint(10) NO MUL NULL
component varchar(100) NO MUL
filearea varchar(50) NO
itemid bigint(10) NO NULL
filepath varchar(255) NO
filename varchar(255) NO
userid bigint(10) YES MUL NULL
filesize bigint(10) NO NULL
mimetype varchar(100) YES NULL
status bigint(10) NO 0
source longtext YES NULL
author varchar(255) YES NULL
license varchar(255) YES NULL
timecreated bigint(10) NO NULL
timemodified bigint(10) NO NULL
sortorder bigint(10) NO 0
referencefileid bigint(10) YES MUL NULL
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template