To count the columns of your table precisely, you can get form information_schema.columns with passing your desired Database(Schema) Name and Table Name.
Reference the following Code:
SELECT count(*)
FROM information_schema.columns
WHERE table_schema = 'myDB'
AND table_name = 'table1';