I know that I can count how many rows have a certain string in the columns of my table like this...
$timeOfClass="W-7PM-A";
$inclass101 = $db->prepare("SELECT count(*) FROM students WHERE timeOfClass =?");
$inclass101->execute(array($timeOfClass));
$inclass101rows = $inclass101->fetchColumn(0);
$inClass101rows reflects the number of rows in my database with $timeOfClass as W-7PM-A.
But how can I do this for multiple variables of the $timeOfClass string without writing multiple SQL statements? I have a lot of them. Would this be something like make an array of SQL statements and then run them through a while loop of fetchColumn(0) ?
WHERE timeOfClass IN ('W-7PM-A', 'W-7PM-B', 'W-7PM-C');(usingIN) then the array.