weired data output about PHP & MySQLi : I am the beginner of PHP & MySQL and I am practicing about PHP & MySQL. It's wired that only Field name is correct but others. I can't get the the expected result from the code... 
How get the correct meta data from the database?
[The expected result][1]


[Actual result][2]


  [1]: http://i.stack.imgur.com/dESiN.jpg
  [2]: http://i.stack.imgur.com/asWKY.jpg

    <?php
		 // Open a connection to the server and USE the winestore
		   $link = mysqli_connect("localhost","root","","winestore");

		   /* check connection */
		   if (mysqli_connect_errno()) 
		   {
		       printf("Connect failed: %s\n", mysqli_connect_error());
		       exit();
		   }

		   // Run a query on the wine table in the winestore database to retrieve
		   // one row
		   $query = "SELECT * FROM wine LIMIT 1";
		   $result = mysqli_query($link, $query);

		   // Output a header, with headers spaced by padding
		   print "\n" .
		   		 str_pad("Field", 20) .
		         str_pad("Type", 14) .
		         str_pad("Null", 6) .
		         str_pad("Key", 5) .
		         str_pad("Extra", 12) . "\n";

		   // How many attributes are there?
		   $x = mysqli_num_fields($result);

		   // for each of the attributes in the result set
		   for($y=0;$y<$x;$y++)
		   {
		      // Get the meta-data for the attribute
		      $info = mysqli_fetch_field ($result);

		      // Print the attribute name
		      print str_pad($info->name, 20);

		      // Print the data type
		      print str_pad($info->type, 6);

		      // Print the field length in brackets e.g.(2)
		      print str_pad("({$info->max_length})", 8);

		      // Print out YES if attribute can be NULL
		      if ($info->not_null != 1)
		          print " YES ";
		      else
		          print "     ";

		      // Print out selected index information
		      if ($info->primary_key == 1)
		         print " PRI ";
		      elseif ($info->multiple_key == 1)
		         print " MUL ";
		      elseif ($info->unique_key == 1)
		         print " UNI ";

		      // If zero-filled, print this
		      if ($info->zerofill)
		         print " Zero filled";

		      // Start a new line
		      print "\n";
		   }
		   mysqli_free_result($result);
		   mysqli_close($link);
		?>