开发者

mysql_field_type differentiate between varchar and text

开发者 https://www.devze.com 2023-01-02 18:35 出处:网络
I need to get the datatype of a column, 开发者_如何学编程but both varchar and text datatypes both return the value \'string\' under the mysql_field_type function in php.

I need to get the datatype of a column, 开发者_如何学编程but both varchar and text datatypes both return the value 'string' under the mysql_field_type function in php.

Is there a better, more specific method of checking a columns datatype?


You can always run a SHOW COLUMNS IN your_table query (via the regular mysql_query() function), which gives you details on the table's columns.


You are in wrong, mysql_field_type function in php does not return 'string' for the 'text' datatype, but 'blob'.

0

精彩评论

暂无评论...
验证码 换一张
取 消