Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** RapidMod.io **/
- /** Find foreign keys by table **/
- SELECT
- TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME,
- REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
- FROM
- INFORMATION_SCHEMA.KEY_COLUMN_USAGE
- WHERE
- REFERENCED_TABLE_SCHEMA = '{$dbname}'
- AND
- TABLE_NAME = '{$table}'
Advertisement
Add Comment
Please, Sign In to add comment