How can i get Attributes value of field

When i am use the following query i can get all fields property

SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'DatabseName'  AND TABLE_NAME = 'TableName';

but i can't find Attributes value like ON UPDATE CURRENT TIMESTAMP of Timestamp field

Otherwise when i edit MySQL fields with phpMyAdmin i can see Attributes values

My question is: How can i get field attributes, and where is this value stored?
Who is Participating?
Mahdi78Author Commented:
I found solution by using the following

show create table TableName;

You will get with this query, the query which created table, then you can find Attribute value

CREATE TABLE `attribute` (
  `111` varchar(10) NOT NULL,
  `222` int(10) unsigned NOT NULL,
  `333` int(10) unsigned zerofill NOT NULL,
  `444` timestamp NOT NULL default '0000-00-00 00:00:00' on update CURRENT_TIMESTAMP
Mark BradyPrincipal Data EngineerCommented:
You can use "DESCRIBE followed by your table name and it will print out each item in the table and their attrributes. Here's a quick example:

$sql = "DESCRIBE `users`";
$result = mysql_query($sql);
$data = mysql_fetch_assoc($result);

That will print out all columns and their attributes for a table named 'users'

Hope that is what you meant
Mahdi78Author Commented:
That doesn't display Attributes property, it show just Field, Type, Null, Key, Default and Extra property
What i want is Attributes property which contain UNSIGNED, UNSIGNED ZEROFILL or ON UPDATE CURRENT_TIMESTAMP data?
Mark BradyPrincipal Data EngineerCommented:
Ok sorry about that. I can't help you unfortunately
Mahdi78Author Commented:
I raised point to 500, any help?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.