title: import data from localhost(phpmyadmin) to a web page"Highcharts"(as a project in phpmyadmin)
body: <p>this is the code to display a columnrange(graphic in highcharts) in a web page with data from Phpmyadmin.The connection is estbalished but any thing is displayed when we make a request to our DB..Can you help me?
  the code:</p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;?php
  
                    $db = mysqli_connect('localhost', 'root') or die("Error " . mysqli_error($db)); 
  mysqli_set_charset($db,"utf8");
  
  // on sélectionne la base 
  $db_selected=mysqli_select_db($db,'outil_échantillonnage_et_analyse_de_données') or die("Error in the consult.." . mysqli_error($db)); 
  ?&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
          &lt;title&gt;Highcharts Example&lt;/title&gt;
  
          &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"&gt;&lt;/script&gt;
          &lt;style type="text/css"&gt;
  ${demo.css}
          &lt;/style&gt;
          &lt;script type="text/javascript"&gt;
  $(function () {
  
      $('#container').highcharts({
  
          chart: {
              type: 'columnrange',
              inverted: true
          },
  
          title: {
              text: 'Moyenne age'
          },
  
          subtitle: {
              text: 'informations sur la moyenne d age des participants'
          },
  
          xAxis: {
              categories: []
          },
  
          yAxis: {
              title: {
                  text: 'Age ( ans )'
              }
          },
  
          tooltip: {
              valueSuffix: 'ans'
          },
  
          plotOptions: {
              columnrange: {
                  dataLabels: {
                      enabled: true,
                      formatter: function () {
                          return this.y + 'ans';
                      }
                  }
              }
          },
  
          legend: {
              enabled: false
          },
  
          series: [{
              name: 'moyenne age',
              data: [&lt;?php
  
  // on crée la requête SQL 
  $sql = 'SELECT question2 FROM questionnaire'; 
   do {  echo $data['question2'];  } while ($data = mysql_fetch_assoc($sql)); 
  
  // on envoie la requête 
  $req = mysqli_query($db, $sql) ; 
  
                                   do { ?&gt;&lt;?php switch ($data['question2']) {
                                  case 'moins de 18ans':?&gt;
                                      [0.0,18.0],
                                     &lt;?php break;
                                  case '18-35 ans':?&gt;
                                      [18.0,35.0],
                                      &lt;?php break;
                                  case '35-60 ans':?&gt;
                                       [35.0,60.0];
                                     &lt;?php break;
                                  case 'plus de 60ans':?&gt;
                                      [60.0,100.0];
                                     &lt;?php break;
                              }; ?&gt;,&lt;?php } while ($data = mysqli_fetch_assoc($req); 
  
                       ?&gt;,
  
              ]
          }]
  
      });
  
  });
  &lt;?php 
  mysqli_close($db); 
  ?&gt;
  
          &lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
  &lt;script src="../../js/highcharts.js"&gt;&lt;/script&gt;
  &lt;script src="../../js/highcharts-more.js"&gt;&lt;/script&gt;
  &lt;script src="../../js/modules/exporting.js"&gt;&lt;/script&gt;
  
  &lt;div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"&gt;&lt;/div&gt;
  
  
      &lt;/body&gt;
  &lt;/html&gt;}
  </code></pre>