Below is some code i tried to do this, I am using mysql 5.0+ and innodb engine. Can i use getColumnMeta
(experiment ?) and how to use it to get datatype metadata?
Thank you.
$types = array(
PDO::PARAM_BOOL => 'bool',
PDO::PARAM_NULL => 'null',
PDO::PARAM_INT => 'int',
PDO::PARAM_STR => 'string',
PDO::PARAM_LOB => 'blob',
);
try{
$sql = 'SELECT COUNT(*) FROM subscriber,list_sub WHERE list_sub.ListID =? AND list_sub.SubID = subscriber.SubID ';
$stmt = $conn->prepare($sql);
$stmt->execute(array($list));
$meta = $stmt->getColumnMeta(0);
var_dump($meta);
}
catch(PDOException $e)
{
die ($e->getMessage()."<a href='view.php' onClick='window.location.reload()'> Back</a>");
}