title: Fetching data from a temporary table
body: <p>I am not able to fetch data from a temporary table that I have just created with a SELECT statement off another table.</p>
  <pre><code>$link = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
  /* check connection */
  if (mysqli_connect_errno()) {
      printf(&quot;Connect failed: %s\n&quot;, mysqli_connect_error());
      exit();}
  
  $query = &quot;create temporary table temp1 select name from trn_games&quot;;
  
  $query2 = &quot;select name from temp1&quot;;
  
  $result = mysqli_query($link, $query2) or die(mysqli_error()); 
  while($row = mysqli_fetch_array($result)) {
  echo $row['name'];
  }
  </code></pre>