I wanted to know how to make MySQL count specific rows where a certain condition is true (All rows where the value for foo = bar) and return this value as a variable like:
SELECT COUNT(*) FROM test WHERE foo LIKE '".bar."'
and make this return e.g. 20 because there are 20 rows that contain bar