function type($val)
{
switch (gettype($val)) {
case 'NULL':
return \PDO::PARAM_NULL;
case 'boolean':
return \PDO::PARAM_BOOL;
case 'integer':
return \PDO::PARAM_INT;
case 'resource':
return \PDO::PARAM_LOB;
case 'float':
return self::PARAM_FLOAT;
default:
return \PDO::PARAM_STR;
}
}