I’m storing document information (Word, excel, …) in a MySQL database.
I have a column "size" where I store the filesize in bytes like 582656, 136260, 383266…
But when I order by size, the results are a little bit disorderly. What type of MySQL field should I use?
I’ve tried VARCHAR and INT, the same result.
I’m storing document information (Word, excel, …) in a MySQL database. I have a
Share
VARCHAR will definitely give you the incorrect results as is will sort from left to right.
But INT should give you what you require.
Have a look at a couple of types here
Numeric Types