title: I cannot display procedures as I want
body: <p>I'm not sure how to proceed in order to display the results of my MySQL on my website. I know that my procedures are working locally. I can only display one one of the select and when I print the result with one select I would like to display on two lines and I can't so I would like to have some suggestions. I did not find any clear answers on other posts</p>
  <pre><code>use kino;
  DROP procedure IF EXISTS `nbrCas`;
  DROP procedure IF EXISTS `Ville`;
  DROP procedure IF EXISTS `Police`;
  delimiter $$
  
  create  procedure nbrCas()
  begin
      DECLARE cnt INT DEFAULT 0 ;
      DECLARE max INT DEFAULT 0 ;
      DECLARE year int DEFAULT 0 ;
      DECLARE minYear int DEFAULT 50 ;
      DECLARE maxYear int DEFAULT 0 ;
      DECLARE counterYear int DEFAULT 0;
      DECLARE big int default 0 ;
      DECLARE min int default 50 ;
      create temporary table year select DISTINCT YEAR(Ertaussstrahlung) from folge ;
      
      select count(*) into max from year;
      WHILE cnt &lt; max
      DO
          set year=(select * from year limit 1 offset cnt);
          set counterYear = (select count(*) from folge where Ertaussstrahlung &gt;=CONCAT(year,'-','01','-','01') and Ertaussstrahlung &lt; CONCAT((year + 1),'-','01','-','01')) ;
          IF counterYear &gt; big
          THEN
              set big = counterYear;
              set maxYear = year;
          END IF;
          IF counterYear &lt; min
          then
              set min = counterYear;
              set minYear = year;
          END IF;
      
          SET cnt=cnt+1;
      END WHILE;
      select &quot;L'année ayant eu le plus de cas:&quot;, maxYear,&quot;\n&quot;;
      select &quot;L'annee ayant eu le plus de cas:&quot;,minYear;
      
      drop table year;
  END;
  create procedure Ville()
  begin
      DECLARE max int DEFAULT 0 ;
      DECLARE cnt int DEFAULT 0 ;
      DECLARE ville varchar(100);
      DECLARE counterVille int DEFAULT 0 ;
      DECLARE biggest int DEFAULT 0 ;
      DECLARE smallest int DEFAULT 1000 ;
      DECLARE villeWin varchar(100);
      DECLARE villeMin varchar(100);
      create temporary table ville select DISTINCT(stadt) from folge ;
      select count(*) into max from ville;
      WHILE cnt &lt; max
      DO
          set ville = (select * from ville limit 1 offset cnt);
          
          SET counterVille = (select count(*) from folge where stadt=ville);
          IF counterVille &gt; biggest
          then
              set biggest = counterVille;
              set villeWin = ville;
          END IF;
          IF counterVille &lt; smallest
          then
              set smallest = counterVille;
              set villeMin = ville;
          END IF;
          set cnt = cnt +1;
      END WHILE;
      select biggest;
      select villeWin;
      select smallest;
      select villeMin;
      drop table ville;
  END;
  
  create procedure Police()
  begin
      DECLARE max int DEFAULT 0 ;
      DECLARE cnt int DEFAULT 0 ;
      DECLARE Policier varchar(100);
      DECLARE counterPolicier int DEFAULT 0 ;
      DECLARE biggest int DEFAULT 0 ;
      DECLARE smallest int DEFAULT 1000 ;
      DECLARE PolicierMin varchar(100) ;
      DECLARE PolicierMax varchar(100) ;
  
  
      create temporary table police select DISTINCT(Ermittler) from folge ;
      select count(*) into max from police;
  
      WHILE cnt &lt; max
      DO
          set Policier = (select * from police limit 1 offset cnt);
          set counterPolicier = (select count(*) from folge where Ermittler = Policier);
          IF counterPolicier &gt; biggest
          then
              set biggest = counterPolicier;
              set PolicierMax = Policier;
          END IF;
          IF counterPolicier &lt; smallest
          then
              set smallest = counterPolicier;
              set PolicierMin = Policier;
          END IF;
          set cnt = cnt + 1;
      END WHILE;
      select biggest;
      select PolicierMax;
      select smallest;
      select PolicierMin;
      drop table police;
  END;
  $$
  
  &lt;?php
      $gateway = new EpisodeGateway();    
     $db = $gateway-&gt;acces_db();
     $result = array();
     $result = mysqli_query($db,'call nbrCas');
     $result = mysqli_fetch_all($result);
     foreach($result as $val)
     {
      foreach($val as $value)
      {
          echo $value;
      }
     }
  ?&gt;
  </code></pre>