How to Get Data type for one column ?
$sColumnType = $db->Query("SELECT $sColumn FROM $sTable ");
$sColType= gettype($sColumnType);
echo $sColumnType;
echo "aaa<br><br>aaa<br>";
echo $sColType;
I try this one but no luck.
$resultType = $db->MetaColumns($sTable);
if ($resultType === false) die("failed");
print_r($resultType);
echo "aaa<br>";
This only bring array. Which I dun want
SAMPLE OUTPUT:
Array ( [SOURCE] => ADOFieldObject Object ( [name] => source [max_length] => 5 [type] => varchar [has_default] => [not_null] => )
=> ADOFieldObject Object ( [name] => code [max_length] => 9 [type] => varchar [has_default] => [not_null] => ) [UPCODE] => ADOFieldObject Object ( [name] => upcode [max_length] => 9 [type] => varchar [has_default] => [not_null] => ) [NAME] => ADOFieldObject Object ( [name] => name [max_length] => 40 [type] => varchar [has_default] => [not_null] => ) [OLDNAME] => ADOFieldObject Object ( [name] => oldname [max_length] => 40 [type] => varchar [has_default] => [not_null] => ) [UPNAME] => ADOFieldObject Object ( [name] => upname [max_length] => 40 [type] => varchar [has_default] => [not_null] => ) [IC] => ADOFieldObject Object ( [name] => ic [max_length] => 16 [type] => varchar [has_default] => [not_null] => ) [N_IC] => ADOFieldObject Object ( [name] => n_ic [max_length] => 12 [type] => varchar [has_default] => [not_null] => ) [PASSPORT] => ADOFieldObject Object
I use PHP ADODB , how can I get the column data type ?
Thanks in advance. :)