Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Show Column Comment - MySQL - PHP

Posted on 2010-09-08
3
1,203 Views
Last Modified: 2012-05-10
Hi E's,
I want to know how I get/show the comment of each column in my table (MySQL).

For example, I use this code for get the name of columns:
$tnames_result = mysql_query("SHOW COLUMNS FROM zz_botoes FROM wwdablio_www", $db);
$tnames_rows = mysql_num_rows($tnames_result);
while($tnames = mysql_fetch_array($tnames_result)){
echo $tnames[0];
}

Note: zz_botoes is the name of the table, and wwdablio_www was the name of db.
How I do for see the comments of each column of table zz_botoes?

Regards, JC
0
Comment
Question by:Pedro Chagas
  • 2
3 Comments
 
LVL 43

Expert Comment

by:Chris Stanyon
ID: 33630061
Include the word FULL before COLUMNS

SHOW FULL COLUMNS FROM.....

Your result will include a column called 'comments'


0
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 500 total points
ID: 33630076
Sorry, that should be 'Comment'



$tnames_result = mysql_query("SHOW FULL COLUMNS FROM zz_botoes FROM wwdablio_www", $db);
$tnames_rows = mysql_num_rows($tnames_result);
while($tnames = mysql_fetch_array($tnames_result)){
echo $tnames[0];
echo $tnames['Comment'];
}

Open in new window

0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 33630183
SHOW FULL COLUMNS FROM...
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question