Search code examples
phpmysqldatabaseresolutionvarchar

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)


Solution

  • 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.