select count(*) from information_schema.columns where table_schema=‘databasename’ and table_ name=‘tablename’ ;