Solved

Show Column Comment - MySQL - PHP

Posted on 2010-09-08
3
1,209 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
[X]
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
  • 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 110

Expert Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

690 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