MySQL Forums
Forum List  »  PHP

Re: How to determine the value of a specific column in a row?
Posted by: Barry Galbraith
Date: November 07, 2012 08:13PM

SHOW INDEX FROM table_name will show you the PRIMARY key for the table.

or you can use information_schema

SELECT column_name
FROM information_schema.key_column_usage
WHERE constraint_name = 'primary'
AND table_schema = 'db_name' -- insert your database name here
AND table_name = 'table_name'  -- insert your table name here
;

Good luck,
Barry.



Edited 1 time(s). Last edit at 11/07/2012 08:25PM by Barry Galbraith.

Options: ReplyQuote


Subject
Written By
Posted
Re: How to determine the value of a specific column in a row?
November 07, 2012 08:13PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.