Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

do I have to specify integer length when creating an id field in MySQL through phpMyAdmin?

I saw someone not set the length in a tutorial but it was specifically for counting the total number of users and just set to auto-increment. I've been of the habit of always specifying a length because I thought it was mandatory, but I wanted to ask if I can leave it blank unless it specifically a date or pin number etc where the length is always set. (I used to set it as 11 digits or more if I wasn't sure)

like image 836
Simon Suh Avatar asked Aug 13 '11 22:08

Simon Suh


1 Answers

Every integer field defaults to 11 when left blank so you can leave it.

like image 97
Cydonia7 Avatar answered Sep 23 '22 15:09

Cydonia7