Count number of columns in table
select count(column_name) from information_schema.columns where table_name='foo';
Updated less than a minute ago
select count(column_name) from information_schema.columns where table_name='foo';
Updated less than a minute ago