Search code examples
phpmysqldoctrine-ormsymfony4

Get the table name / entity of a column


I would like to check if there is a table in my MySQL database, which has a column called country. If so, I would like to know the table name / entity of it.

Is that possible?


Solution

  • show tables from database like 'country';
    

    Using like to have the exact match, if your query returns result that means there is a table else there isn't.