PHP 4.0 Bug #5750: mysql_list_fields() returns no rows
| From: | bughuntr at ctelcom dot net | Date: | Sun, 23 Jul 2000 21:42:28 +0000 |
| Subject: | PHP 4.0 Bug #5750: mysql_list_fields() returns no rows | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-25613@lists.php.net to get a copy of this message | ||
From: bughuntr@ctelcom.net
Operating system: RedHat 6.2
PHP version: 4.0.1pl2
PHP Bug Type: MySQL related
Bug description: mysql_list_fields() returns no rows
the following script produces no rows for mysql_list_fields. the root user has permission to see
fields in the db table on the mysql database. This test failed identically on MySQL 3.22, and MySQL
3.23 beta:
<?
$mysql_link = mysql_connect("localhost","root","mypassword");
$mysql_result = mysql_list_dbs($mysql_link);
$n = 0;
while ($row = mysql_fetch_row($mysql_result))
{
print("mysql_result (list_dbs) = $mysql_result<br>");
$n++;
printf("Database number $n = %s<br>",$row[0]);
$mr2 = mysql_list_fields("mysql","db",$mysql_link);
print ("mr2=$mr2<br>");
while ($rl = mysql_fetch_row($mr2))
{
$f++;
print("Field number $f = $rl[0]<br>");
}
} // $row
echo "<BR>";
mysql_close($mysql_link);
?>
the script put out the following. I originally tried with multiple variables in the
mysql_list_fields, but narrowed it down to a database and table I new existed:
mysql_result (list_dbs) = Resource id #2
Database number 1 = mysql
mr2=Resource id #3
mysql_result (list_dbs) = Resource id #2
Database number 2 = test
mr2=Resource id #4