Is there a way to get the name of primary key field from mysql-database? For example:
I have a table like this:
+----+------+ | id | name | +----+---
SELECT k.column_name FROM information_schema.key_column_usage k WHERE k.table_name = 'YOUR TABLE NAME' AND k.constraint_name LIKE 'pk%'
I would recommend you to watch all the fields