title: how to category list? [PHP accordion]
body: <p>I need to create unlimited categories, and ı use php + mysql.</p>
  <p>My database struct.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">id</th>
  <th style="text-align: center;">name</th>
  <th style="text-align: right;">parent_id</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">1</td>
  <td style="text-align: center;">Electronic</td>
  <td style="text-align: right;">0</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: center;">Laptop</td>
  <td style="text-align: right;">1</td>
  </tr>
  <tr>
  <td style="text-align: left;">3</td>
  <td style="text-align: center;">Desktop</td>
  <td style="text-align: right;">1</td>
  </tr>
  <tr>
  <td style="text-align: left;">4</td>
  <td style="text-align: center;">Car</td>
  <td style="text-align: right;">0</td>
  </tr>
  <tr>
  <td style="text-align: left;">5</td>
  <td style="text-align: center;">Renault</td>
  <td style="text-align: right;">4</td>
  </tr>
  <tr>
  <td style="text-align: left;">6</td>
  <td style="text-align: center;">Megane</td>
  <td style="text-align: right;">5</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>the look i want to achieve ;</p>
  <p><a href="https://i.stack.imgur.com/uEnkb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uEnkb.png" alt="enter image description here" /></a></p>
  <p>I want to make an accordion menu like this with php but I couldn't find an example, really.</p>
  <p>Can you recommend me a method?</p>