title: Echo an embedded YouTube video from database
body: <p>I'm trying to echo a YouTube embedded video using my database.
  But I can't figure out where my error is..</p>
  
  <p>Config.php file:</p>
  
  <pre><code>$servername = "localhost";
  $username = "root";
  $password = "";
  $db = "dbname";
  
  // Create connection
  $conn = mysqli_connect($servername, $username, $password, $db);
  
  // Check connection
  if (!$conn) {
      die("Connection failed: " . mysqli_connect_error());
  }
  </code></pre>
  
  <p>And here I'm trying to echo the YouTube video:</p>
  
  <pre><code>include ("/includes/config.php");
  $query = "SELECT * FROM table_name";
  $result = mysqli_query($link, $query);
  while ($row = mysqli_fetch_array($result)) {
      echo "&lt;iframe width='560' height='315' src='https://www.youtube.com/embed/".$row['video']."' frameborder='0' allowfullscreen&gt;&lt;/iframe&gt;";
  }
  mysqli_close($link);
  </code></pre>
  
  <p>In the echo part, I'm echoing $row['video'], video is the code from the YouTube video that every video has.</p>
  
  <p>But it still doesn't work, someone can help me out please?</p>