php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48536 mysql_fetch_field not returning default value
Submitted: 2009-06-12 10:58 UTC Modified: 2009-06-15 08:49 UTC
From: ben6691 at gmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.2.9 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ben6691 at gmail dot com
New email:
PHP Version: OS:

 

 [2009-06-12 10:58 UTC] ben6691 at gmail dot com
Description:
------------
The mysql_fetch_field function isn't returning the default value of a column.

Reproduce code:
---------------
$res2 = mysql_query("SELECT * FROM `$tablename`");


while ($property = mysql_fetch_field($res2)){
echo "Field name: " . $property->name . "<br />";
echo "Table name: " . $property->table . "<br />";
echo "Default value: " . $property->def . "<br /><br />";
}		


Expected result:
----------------
Field name: pages
Table name: prefix_smallCMS_site
Default value: no


Actual result:
--------------
Field name: pages
Table name: prefix_smallCMS_site
Default value: 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-15 08:49 UTC] jani@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

See bug #16384
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 07:01:30 2024 UTC