I have a table in my database which save up to 60 fields with a yes or a no. I am wanting to COUNT or get the SUM off all fields from the table WHERE any of the fields equal to 'yes';

I have tried the following but no luck:

```
SELECT count(*) FROM information_schema.columns WHERE table_name = 'portraits';

```

This will return the column count but doesn't allow me to count the fields where they equal to 'yes'. 

I am wondering is this easier to do in php? I am currently doing this in codeigniter and I don't know how to read the key/value as it is an object. Any ideas?