can someone help me on the proper way of using a variable with multiple values in MySQL LIKE clause?

by the way, I have two tables teacher and student.

Teacher table contains. (fname,lname,subject,yr,sec) columns and for the student table (lrn,yr,sec)

what I'm trying to achieve is to count the total number of students of the teacher from all sections.

Here's my query for getting teacher's sections:

```
<?php
        $result= mysqli_query($con, "select *from teacher where lname 
= 'Uy' and subject = 'Science & Technology 7'" );

    while($rowx = mysqli_fetch_array($result)) { 
    $section = $rowx['sec']; 
    }
        ?>

```

echoing $section output this: Our Lady of FatimaOur Lady of Guadalupe 

Heres my query to count the students.

```
                        <?php
 $ratequery = mysqli_query($con, "SELECT *, 
                   (SELECT COUNT(*) FROM student WHERE 
 sec LIKE '%$section%') AS responseCount FROM student");        
    $rateresult = mysqli_fetch_array($ratequery);

        ?>

```

Output: the count works but only the first value [Our Lady of Fatima] of $section is getting recognized by LIKE clause, so only 1 section is getting counted.

by the way, sorry for my bad English and explanation.