php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #61053 mysql_fetch_field should return type = "enum" and enum options
Submitted: 2012-02-11 01:49 UTC Modified: 2012-02-11 11:12 UTC
From: zzatkin at gmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.3.10 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: zzatkin at gmail dot com
New email:
PHP Version: OS:

 

 [2012-02-11 01:49 UTC] zzatkin at gmail dot com
Description:
------------
mysql_fetch_field returns type = "string" for enum fields in the MySQL database, 
but should instead return "enum" and an array of possible values for convenience.

Test script:
---------------
<?php
$connect = mysql_connect('localhost','user','password');
mysql_select_db('some_database',$connect);
$query = mysql_query('SELECT * FROM table');
var_dump(mysql_fetch_field($query,1));
?>

Expected result:
----------------
array(12) {
...
["type"]=>
string(6) "string"
...
}

Actual result:
--------------
array(12) {
...
["type"]=>
array(3) {
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(1) "c"
}
...
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-11 11:12 UTC] johannes@php.net
-Status: Open +Status: Not a bug
 [2012-02-11 11:12 UTC] johannes@php.net
We report the information we get from the MySQL serer. To change this the MySQL Server has to report a different type. Report there.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 01:01:28 2025 UTC