I used PHP to look up some data from MySQL,
But I want to know the data types of these fields, what to do with them,
I don't know what this SQL is or it's not, it's possible that more than one table or field is calculated.
cannot be retrieved by checking the table field.
There is no way, this I like C #, do not manage what SQL isolated data are band type.
Ask for answers
Reply to discussion (solution)
Mysql_field_type--Get the type of the specified field in the result set
Mysql_field_table--Gets the name of the table in which the specified field is located
PHP is a weakly typed language, and the actual type of data is less important.
Mysql_field_type--Get the type of the specified field in the result set
Mysql_field_table--Gets the name of the table in which the specified field is located
Thank you, indeed available, but there is a problem when in SQL. This field is the result of the calculation, it will return the real type, it is obviously wrong,
For example, select A+b from t
。
This is not a problem in C #.
The appearance of real is because the type of a, B differs.
DOUBLE precision[(m,d)] [UNSIGNED] [Zerofill], real[(m,d)] [UNSIGNED] [Zerofill]
is a synonym for double. In addition to: if the SQL Server schema includes the Real_as_float option, Real is a synonym for float instead of a double.
Real Real number
What's wrong with that?
Real Real number
What's wrong with that?
Mostly what I want to get is flaot,int, double these, I don't know what kind of real to belong to.
Because my requirement here is that the user writes a SQL to get the results, I need to use the type as the display.
Real Real number
What's wrong with that?
Mostly what I want to get is flaot,int, double these, I don't know what kind of real to belong to.
Because my requirement here is that the user writes a SQL to get the results, I need to use the type as the display.
Or does real belong to a number?
Real? Double