Reputation: 6728
I know how to check for the existence of a column using the syntax
SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = "my_table" AND COLUMN_NAME = "my_column"
Is there a way to check for the existence of a column when the DB user doesn't have access to the information_schema? Or would you just do something like try a SELECT from that column and if you get an error then you know that the column doesn't exist?
Upvotes: 1
Views: 78