Show Column Name – Query MySQL


How to get all field name or column name table with query mysql :

SELECT column_name FROM information_schema.columns WHERE table_name =’your_table_name’

to display column name like a,b,c , you can use GROUP_CONCAT function,see :

SELECT GROUP_CONCAT(column_name) FROM information_schema.columns WHERE table_name = ‘your_table_name’

Happy Query😀

About blackphp

All about programming php, ajax, jquery, mysql, etc, tips n trick. Now, i'm concern in php programming with codeigniter framework n also training my design skill with photoshop or corel... wish me luck! ('o')

Posted on November 14, 2012, in mYsQL and tagged , , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: