Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is 'comments' field in MySQL phpMyAdmin when creating a table?

I have wondered this for many years and every time I did a search it was totally unrelated to what I am looking for as it thought I was searching for "how to comment out data". When you create a new DB table in phpmyadmin, there is a comments field there. What the heck is that for? :) I assumed it allowed you to leave notes on that field or something, but I tried to enter data in that field once and look around that table and didn't see anything. Please let me know what its purpose is. Thank you :)

like image 400
John Jenkins Avatar asked Oct 29 '25 19:10

John Jenkins


2 Answers

Its simply just a comment so if you need to go back to that column and remember why/how you created it, you can reference it.

For Example: storeHeadID : int, comment: "This is the ID of the store's head office"

like image 98
wesbos Avatar answered Nov 03 '25 02:11

wesbos


Once you added a comment in the comment field for a column, you should see a dotted underline under that column name in the table's structure view. If you mouse-over that underline you will see your comment as a tooltip. It is very handy to keep track of what the different values in the column mean eg. "status 0:disabled, 1:active, 2:suspended etc."

like image 33
srivani Avatar answered Nov 03 '25 04:11

srivani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!