Doc #60691 [Fbk->NoF]: ->def missing default value
| From: | php-bugs at lists dot php dot net | Date: | Mon, 18 Feb 2013 00:35:36 +0000 |
| Subject: | Doc #60691 [Fbk->NoF]: ->def missing default value | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-9547@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=60691&edit=1
ID: 60691
Updated by: php-bugs@lists.php.net
Reported by: bimal at sanjaal dot com
Summary: ->def missing default value
-Status: Feedback
+Status: No Feedback
Type: Documentation Problem
Package: MySQL related
Operating System: Windows XP
PHP Version: Irrelevant
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2012-05-02 10:13:36] 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-01-09 10:30:41] 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'
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=60691&edit=1