mysql_field_types()
| From: | Armin Steiner | Date: | Fri, 21 Apr 2000 14:38:28 +0000 |
| Subject: | mysql_field_types() | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-18102@lists.php.net to get a copy of this message | ||
Dear Core-Developers,
i latley recognized, that the mysql-function "mysql_field_type()" does
not the way as i thought it would do or as it maybe is supposed to do.
Unfortunatley it does not give me the "real" type of a field, and even
does not know the type TINYINT.
I created a table containing all possible types and that's the result:
TINYINT is data-typ unknown
SMALLINT is data-typ int
MEDIUMINT is data-typ int
INT is data-typ int
BIGINT is data-typ int
FLOAT is data-typ real
DOUBLE is data-typ real
DECIMAL is data-typ real
CHAR is data-typ string
VARCHAR is data-typ string
TINYTEXT is data-typ blob
TEXT is data-typ blob
MEDIUMTEXT is data-typ blob
LONGTEXT is data-typ blob
TINYBLOB is data-typ blob
BLOB is data-typ blob
MEDIUMBLOB is data-typ blob
LONGBLOB is data-typ blob
ENUM is data-typ string
SET is data-typ string
DATE is data-typ date
TIME is data-typ time
DATETIME is data-typ datetime
TIMESTAMP is data-typ timestamp
YEAR is data-typ unknown
maybe it is just a bug on Windows, so here the informations about
"my" environment:
Windows98, PHP 3.0.16, MySQL 3.22.29 .
Maybe you can check this if it is right the way it is
or maybe get it working.
I put the CREATE TABLE DUMP at the End of this mail, so that
you can easily test it on your own stations
with best regards,
Armin Steiner
-------------- Cut Table Dump ------------------
CREATE TABLE typen (
id tinyint(4) DEFAULT '0' NOT NULL auto_increment,
tinyintt tinyint(4) DEFAULT '0' NOT NULL,
smallintt smallint(6) DEFAULT '0' NOT NULL,
mediumintt mediumint(9) DEFAULT '0' NOT NULL,
intt int(11) DEFAULT '0' NOT NULL,
bigintt bigint(20) DEFAULT '0' NOT NULL,
floatt float(10,2) DEFAULT '0.00' NOT NULL,
doublet double(10,2) DEFAULT '0.00' NOT NULL,
decimalt decimal(10,2) DEFAULT '0.00' NOT NULL,
chart varchar(255) NOT NULL,
varchart varchar(255) NOT NULL,
tinytextt tinytext NOT NULL,
textt text NOT NULL,
mediumtextt mediumtext NOT NULL,
longtextt longtext NOT NULL,
tinyblobt tinyblob NOT NULL,
blobt blob NOT NULL,
mediumblobt mediumblob NOT NULL,
longblobt longblob NOT NULL,
enumt enum('y','n') DEFAULT 'y' NOT NULL,
sett set('a','b','c') NOT NULL,
datet date DEFAULT '0000-00-00' NOT NULL,
timet time DEFAULT '00:00:00' NOT NULL,
datetimet datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
timestampt timestamp(14),
yeart year(4) DEFAULT '0000' NOT NULL,
PRIMARY KEY (id)
);
-------------- Cut Table Dump END --------------