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
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: vlada at activemedia dot co dot yu
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 15:01:36 2025 UTC