In PHP, how to match id with names which names are in another table
<p><br>
I have a PHP page and try to list my block categories with names instead of id's.
Here is my MariaDB output:</p>

<pre><code>select id,name  from url_category_data;
+----+----------------------+
| id | name                 |
+----+----------------------+
|  1 | adv                  |
|  2 | aggressive           |
|  3 | alcohol              |
|  4 | anonvpn              |
|  5 | automobile/bikes     |
|  6 | automobile/boats     |
|  7 | automobile/cars      |
|  8 | automobile/planes    |
|  9 | chat                 |
| 10 | costtraps            |
+----+----------------------+
</code></pre>

<p>I feed my block list by using those categories and stores as id.
Here is my block category list:</p>

<pre><code>select policyid,category_list from url_category_block where status  = 1 ;
+----------+---------------+
| policyid | category_list |
+----------+---------------+
|        1 | 8,9,10        |
+----------+---------------+
</code></pre>

<p>When I try to use echo I can print out 8,9,10</p>

<pre><code>&lt;p&gt; Result is:   
&lt;?php
     if($result_block===true ||   $row_list = $result_block-&gt;fetch_assoc()){ 
       echo  $row_list["category_list"];}?&gt;
&lt;/p&gt;
</code></pre>

<p>Its output il like that:</p>

<blockquote>
  <p>Result is: 8,9,10</p>
</blockquote>

<p>But I want to display name  of these values, such as;</p>

<blockquote>
  <p>Result is : <br>automobile/planes<br> chat<br> costtraps</p>
</blockquote>

<p>To show my data, I show list as shortly. <br>
Actually there are nearly 150 category name and id. So, I have to automate this match process in PHP
I saw some answer this kind of question, but I am not very familiar with MySQL and PHP, so those answers not clear for me.
How can convert those id numbers to print to screen their names by using PHP?</p>