title: Couldn't load the category php and ajax
body: <p>I am creating an e-commerce website. I completed the design part. While writing the coding part I ran in to the problem on couldn't display the categories inside the <code>&lt;div id="categories"&gt;&lt;li&gt;&lt;li&gt;&lt;/div&gt;</code>
  I attached the code below what tried so far. there is no error displayed how to display the categories inside the <code>div</code> tag.</p>
  
  <p><strong>All categories display inside to this Div like order list</strong></p>
  
  <pre><code>  &lt;div id="categories"&gt;
         &lt;li &gt;&lt;li&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p><strong>Jquery</strong> </p>
  
  <pre><code> function getCategory(){
          $.ajax({
              type: 'GET',
              url: 'all_category.php' ,
              dataType: 'JSON',
              success: function (data) {
               console.log(data);
  
                  $("categories").html(data.catname);
  
              },
              error: function (xhr, status, error) {
                  alert(xhr.responseText);
  //
              }
  
          });
      }
  </code></pre>
  
  <p><strong>Database</strong> <strong>all_category.php</strong></p>
  
  <pre><code>&lt;?php
  include("db.php");
  
  $stmt = $conn-&gt;prepare("select id,catname,status from category order by id DESC ");
  $stmt-&gt;bind_result($id,$catname,$status);
  
  if ($stmt-&gt;execute()) {
      while ( $stmt-&gt;fetch() ) {
          $output[] = array ("id"=&gt;$id, "catname"=&gt;$catname,"status"=&gt;$status);
      }
  
      echo json_encode( $output );
  }
  $stmt-&gt;close();
  
  ?&gt;
  </code></pre>