Alex Oxilg Alex Oxilg - 3 months ago 9
MySQL Question

which datatype for resolution

Which datatype would fit the most for saving resolution into a database?

For example something like:


720x576


I would use a varchar but I am not really sure if that is correct (best practice)

Answer

Use 2 integer columns - height and width. Always store atomic data and never mutliple values in a single column.

unsigned smallint should be enough for your purposes.