Method: 1. Use the desc command, the syntax is "desc table name field"; 2. Use the "show columns" command, the syntax is "show columns from table name like field"; 3. Use the describe command, The syntax is "describe table name field".
The operating environment of this tutorial: windows10 system, mysql8.0.22 version, Dell G3 computer.
1. desc command
Format: desc tablename columnname
Example:
desc `table` `mid` desc `table` '%abc%'
2. show columns command
Format: show columns from tablename like columnname
Example:
show columns from `table` like 'mid' show columns from `table` like '%abc%'
3. describe command
Format: describe tablename columnname
describe is equivalent to show columns from
Example:
describe `table` `mid` describe `table` '%abc%'
Recommended learning:mysql video tutorial
The above is the detailed content of How to determine whether a mysql field exists. For more information, please follow other related articles on the PHP Chinese website!