php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #60691 ->def missing default value
Submitted: 2012-01-09 10:30 UTC Modified: 2013-02-18 00:35 UTC
From: bimal at sanjaal dot com Assigned:
Status: No Feedback Package: MySQL related
PHP Version: Irrelevant OS: Windows XP
Private report: No CVE-ID: None
 [2012-01-09 10:30 UTC] bimal at sanjaal dot com
Description:
------------
---
From manual page: http://www.php.net/function.mysql-fetch-field#refsect1-function.mysql-fetch-field-returnvalues
---
http://www.w3schools.com/php/func_mysql_fetch_field.asp
(Purpose: Some reference back to $meta->def)

The field - def - does not contain the default value of the mysql column - even if the default values were defined in the table.

(PS - The new/upgraded version of PHP manual simply hide this field)

I have used PHP 5.3.5 from XAMPP 1.7 version.

Test script:
---------------
type:         $meta->type
default:      $meta->def
unique_key:   $meta->unique_key

Here, the default value is always missing or returning empty variable.

Expected result:
----------------
Default value assiged to the mysql column while creating it using: DEFAULT 'XXX'.

For example,
`is_active` enum('N','Y') NOT NULL DEFAULT 'N' COMMENT 'Active record?',

Here, for the field is_active, we should have seen 'N'


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-02 10:13 UTC] uw@php.net
Please, provide a sample script. That is a short script using mysql_connect, mysql_query and mysql_fetch_field. Judging from the 5.3 and 5.4 source tree, def is provided since 2004. Its actual value is taken from the underlying C library which in turn gets it from the server - want to say that the actual value is server version dependent.
 [2012-05-02 10:13 UTC] uw@php.net
-Status: Open +Status: Feedback
 [2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 22:01:27 2024 UTC