Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Show Column Comment - MySQL - PHP

Posted on 2010-09-08
3
Medium Priority
?
1,216 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 44

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 44

Accepted Solution

by:
Chris Stanyon earned 2000 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 111

Expert Comment

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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this article, we’ll look at how to deploy ProxySQL.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

916 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