title: PHP Routing: use SQL result as "router"
body: <p>I have the following index.php:</p>
  
  <pre><code>&lt;?php
  $uri = $_SERVER["REQUEST_URI"];
  
  require_once "sql.php";
  $link = mysqli_connect($host, $user, $pw, $db);
  $urls = $link-&gt;query("SELECT URL FROM TEST");
  
      switch ($uri) {
      case "/":
      header("location: http://www.mysite.com/en/index.php");
      break;
  
      while($rurl = mysqli_fetch_array($urls)){
          case $rurl['URL']:
              header("location: http://www.mysite.com/folder/page.php?test=$rurl['URL']");
           break;
      }
  
      default:
          include "errors/404.php";
          header("HTTP/1.0 404 Not Found");
      break;
  }
  ?&gt;
  </code></pre>
  
  <p>I get a couple of errors on the while loop. How can I insert a "case:" into the while?</p>
  
  <p>Thank you</p>