php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19385 mysql_field_type
Submitted: 2002-09-13 02:32 UTC Modified: 2002-09-13 04:31 UTC
From: vlada at activemedia dot co dot yu Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.2.3 OS: Windows 2000
Private report: No CVE-ID: None
 [2002-09-13 02:32 UTC] vlada at activemedia dot co dot yu
I'm using MySQL V3.23.51-nt.
When used "mysql_field_type" function I found wrong reported types -- or differentone than with "SHOW FIELDS FROM". Here are only some examples:
------------------------------------------------------
mysql_field_type         | SHOW FIELDS FROM
------------------------------------------------------
string                   | varchar(150)
------------------------------------------------------
blob                     | text
------------------------------------------------------
int                      | int(11)
------------------------------------------------------
int                      | tinyint(4)
------------------------------------------------------
real                     | float
------------------------------------------------------
year                     | year(4)
------------------------------------------------------
I hope it would help you to find out where is a problem. It seems that mysql_field_type has poor description of the filed types and many similar types it reports the same

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-13 04:31 UTC] georg@php.net
mysql_field_type returns if there is an equivalent datatype, the php datatype, otherwise the MySQL data type.

Note that there is no diffrence between blob and text in MYSQL_FIELD structure.

To get the exact mysql datatypes from a table use mysql_query ("describe table").
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 29 07:01:31 2024 UTC