title: Why does the function of two database queries show me only the result of the first query?
body: <p>The output of the following shows me the result of the first query, but not the second. When I make the queries without function it works.</p>
  <pre><code>function builtFooter($catactive, $catlink)
  {
      global $conn;
      $sql = &quot;SELECT catid, catname_de AS name, catlink as link, extern, extlink FROM categories WHERE catactive=? AND catlink!=? ORDER BY catsort&quot;;
      $stmt = $conn-&gt;prepare($sql);
      $stmt-&gt;bind_param(&quot;ss&quot;, $catactive, $catlink);
      $stmt-&gt;execute();
      $result = $stmt-&gt;get_result();
      while ($cat = $result-&gt;fetch_assoc()) {
          $resArr[] = $cat;
          echo '&lt;h3&gt;&lt;a href=&quot;' . $cat['link'] . '&quot; title=&quot;' . $cat['name'] . ' bei $portalname&quot;&gt;' . $cat['name'] . '&lt;/a&gt;&lt;/h3&gt;';
  
          $cities = &quot;SELECT COUNT(a.ad_id) AS ANZ,a.region, b.city, b.citylink FROM ads a, neueorte b WHERE a.zeigen=? AND a.gesperrt=? AND FIND_IN_SET(?, a.portale) AND a.catid=? AND b.po_id=a.region GROUP BY a.region ORDER BY ANZ DESC LIMIT 0,50&quot;;
          $stmt = $conn-&gt;prepare($cities);
          $zeigen = 'ja';
          $gesperrt = 'no';
          $category = $cat['catid'];
          $stmt-&gt;bind_param(&quot;ssss&quot;, $zeigen, $gesperrt, $portalnumber, $category);
          $stmt-&gt;execute();
          $result = $stmt-&gt;get_result();
          while ($city = $result-&gt;fetch_assoc()) {
              $resArr[] = $city;
              echo ' ' . $city['city'] . ' &lt;br /&gt;';
          }
      }
  }
  
  builtFooter('yes', 'markt');
  </code></pre>