How to detect a TINYINT/BOOLEAN Column of a query result
How can I detect TINYINT or BOOLEAN field from a Query Result
Discussion and support for DEVSENSE software.
http://support.devsense.com/
How can I detect TINYINT or BOOLEAN field from a Query Result
Hi,
http://php.net/manual/en/function.mysql-fetch-field.php look for the result value, the "type" field?
Regards,
Jakub Misek
@Jakub, thanks so much for your response, but what I mean is that how can I determine if a column is really a TINYINT, MySQL convert Boolean to Tinyint (1) automatically.
In mysql_fetch_field or mysql_fetch_type Tinyint and other numeric type column are returned as "int" type in normal php.
I am write a phalanger application that will create columns in DataDridView automatically according to the structure of result of a query and I want any field of the result with TINYINT in MySQL to form a grid column ofSystem.Boolean as it DataType so as to display CheckBox instead of a System.String column that will dislay ordinary text.
More so, I will like to participate by submitting simple projects as tutorials for new users to go through.
Hope to here from you soon,
Thanks.
mysql_query("SHOW COLUMNS FROM $table")