Req #61053 [Opn->Nab]: mysql_fetch_field should return type = "enum" and enum options

From: Date: Sat, 11 Feb 2012 11:12:26 +0000
Subject: Req #61053 [Opn->Nab]: mysql_fetch_field should return type = "enum" and enum options
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-167428@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61053&edit=1 ID: 61053 Updated by: johannes@php.net Reported by: zzatkin at gmail dot com Summary: mysql_fetch_field should return type = "enum" and enum options -Status: Open +Status: Not a bug Type: Feature/Change Request Package: MySQL related Operating System: Linux PHP Version: 5.3.10 Block user comment: N Private report: N New Comment: We report the information we get from the MySQL serer. To change this the MySQL Server has to report a different type. Report there. Previous Comments: ------------------------------------------------------------------------ [2012-02-11 01:49:06] 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" } ... } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=61053&edit=1

« previous php.bugs (#167428) next »