Hi;
I am wondering if there is a simple way to construct a MySQL query that will return just the fieldname (as a string that I could then re-use as a variable value) of the Primary Key for a particular table.
I am trying to build a generic form that will allow users to pick particular rows from various tables for edit or delete purposes. The hard part is that each table in question has a different name for the Primary Key field.
Just on a whim I tried stuff like..
DESCRIBE SCHOOLS WHERE Key LIKE 'PRI'
and
SHOW INDEX FROM SCHOOLS WHERE Key_name like 'PRIMARY'
but those commands don't seem to like the "WHERE" clause.
Any suggestions would be appreciated.
Joe