Check if a field exists in mysql.
You can use the DESCRIBE statement in MySQL to check if a field exists. For example, to see if a field named “column_name” exists in a table, you can use the following statement:
DESCRIBE table_name column_name;
If the returned result is empty, it means that the field does not exist. If the returned result is not empty, it means that the field exists.