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?
LVL 9
Mahdi78Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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);
print_r($data);

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

Hope that is what you meant
0
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?
0
Mark BradyPrincipal Data EngineerCommented:
Ok sorry about that. I can't help you unfortunately
0
Mahdi78Author Commented:
I raised point to 500, any help?
0
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

Ex:
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
) ENGINE=MyISAM DEFAULT CHARSET=latin1
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.