public function GetColumnDataType($column, $table = "")
{
$this->ResetError();
if (empty($table)) {
if ($this->RowCount() > 0) {
if (is_numeric($column)) {
$field = mysqli_fetch_field_direct($this->last_result, $column);
return $field->type;
} else {
$field = mysqli_fetch_field_direct($this->last_result, $this->GetColumnID($column));
return $field->type;
}
} else {
return false;
}
} else {
if (is_numeric($column)) {
$column = $this->GetColumnName($column, $table);
}
$result = mysqli_query($this->mysql_link, "SELECT " . $column . " FROM " . $table . " LIMIT 1");
if (mysqli_field_count($this->mysql_link) > 0) {
$field = mysqli_fetch_field_direct($result, 0);
return $field->type;
} else {
$this->SetError("The specified column or table does not exist, or no data was returned", -1);
return false;
}
}
}