So I am using the following functions to grab the datatype of certain fields in an SQL database.
$type = mysql_field_type($result, $i);
$len = mysql_field_len($result, $i);
I need to use these datatypes to ultimately structure another table. The problem is the returns I am getting from these functions are not valid SQL datatypes, I am getting returns like this: string (25), int (11), string (25)
Int is ok but string is not an SQL datatype, so do I need to figure out which returns need to be reformatted into correct datatypes and make functions to do that? Or am I missing another way to do it?
you will see that the mysql_field_type() function will return the following data as per (http://it2.php.net/mysql_field_type):
Perhaps you can rather try something like:
Hope that helps.