title: How to find the source database name for a field in the result-set in PHP/MySQL API?
body: <p>I have to find the database name from where a field is coming.</p>
  
  <p>In MySQL C API, the db name can be retrieved using the API <a href="http://dev.mysql.com/doc/refman/5.0/en/mysql-fetch-field.html" rel="nofollow">mysql_fetch_field</a>. It returns the <a href="http://dev.mysql.com/doc/refman/5.1/en/c-api-data-structures.html" rel="nofollow">MYSQL_FIELD</a> structure, which contains char *db.</p>
  
  <p>But I am not able to find anything to achieve this. The PHP version of <a href="http://php.net/manual/en/function.mysql-fetch-field.php" rel="nofollow">mysql_fetch_field</a> does not have the database information. Any idea how can I do this?</p>
  
  <p>I also want a solution for mysqli.</p>