ID: 42344
Updated by: [EMAIL PROTECTED]
Reported By: php at michaelho dot com
-Status: Open
+Status: Feedback
Bug Type: MySQLi related
Operating System: Mac OS X 10.4.9
PHP Version: 5.2.3
New Comment:
This is very simple function which just wraps around the provided
libmysql function 'mysql_fetch_field' and pretty much can't be a bug on
the PHP side. What mysql version have you compiled PHP with?
Previous Comments:
------------------------------------------------------------------------
[2007-08-20 05:33:30] php at michaelho dot com
Description:
------------
The object returned from MySQLi's fetch_field() does not ever aggregate
the ->def value.
Reproduce code:
---------------
(mysql database table definition)
CREATE TABLE foo (
some_value VARCHAR(50) DEFAULT 'blah'
);
(PHP Code)
<?php
$mysqli = new mysqli("localhost", "root", "", "test");
$query = "SELECT * from foo";
if ($result = $mysqli->query($query)) {
/* Get field information for all columns */
while ($finfo = $result->fetch_field()) {
printf("Default Value: %s\n", $finfo->def);
}
$result->close();
}
/* close connection */
$mysqli->close();
?>
Expected result:
----------------
Default Value: blah
Actual result:
--------------
Default Value:
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=42344&edit=1