We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
When looking at column definitions in MySQL, you'll see
VARCHAR(255)
and you know it means that the column can store up to 255 characters, and no more.There is a similar-seeming property for numeric types, like
INT(11)
. The database tools I frequently use even show this number in the same way as theVARCHAR
length.I was working in a legacy database recently and saw some very bizarre numbers like
INT(4)
orINT(200)
and it got me curious as to what it actually means, since it doesn't impact the acceptable range of numbers you can store.The MySQL docs explain that this attribute is for setting display width. It's purely for display purposes in database tools that support it. And it's going away. In MySQL 8.0.17, this attribute was deprecated.
continue reading on masteringlaravel.io
⚠️ This post links to an external website. ⚠️
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.