title: PHP code doesn't show MySql table
body: <p>I have used this code to show a table named "me" from a database with "punisher" name.But It doesn't show anything.</p>
  
  <p>Is the problem with my code or another things? I have installed MySql and Apache Web Server in my pc.</p>
  
  <p>Here is the code :</p>
  
  <pre><code>&lt;?php
  $db_host = 'localhost';
  $db_user = 'root';
  $db_pwd = '********';
  
  $database = 'punisher';
  $table = 'me';
  
  if (!mysql_connect($db_host, $db_user, $db_pwd))
      die("Can't connect to database");
  
  if (!mysql_select_db($database))
      die("Can't select database");
  
  // sending query
  $result = mysql_query("SELECT * FROM {$table}");
  if (!$result) {
      die("Query to show fields from table failed");
  }
  
  $fields_num = mysql_num_fields($result);
  
  echo "&lt;h1&gt;Table: {$table}&lt;/h1&gt;";
  echo "&lt;table border='1'&gt;&lt;tr&gt;";
  // printing table headers
  for($i=0; $i&lt;$fields_num; $i++)
  {
      $field = mysql_fetch_field($result);
      echo "&lt;td&gt;{$field-&gt;name}&lt;/td&gt;";
  }
  echo "&lt;/tr&gt;\n";
  // printing table rows
  while($row = mysql_fetch_row($result))
  {
      echo "&lt;tr&gt;";
  
      // $row is array... foreach( .. ) puts every element
      // of $row to $cell variable
      foreach($row as $cell)
      echo "&lt;td&gt;$cell&lt;/td&gt;";
  
      echo "&lt;/tr&gt;\n";
  }
  mysql_free_result($result);
  ?&gt;
  </code></pre>