|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-08-20 09:05 UTC] jani@php.net
[2007-08-20 13:49 UTC] andrey@php.net
[2007-08-20 22:31 UTC] php at michaelho dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 09:00:01 2025 UTC |
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: