public getColumnsSql ( string $database, string $table, string $column = null, boolean $full = false ) : string | ||
$database | string | name of database |
$table | string | name of table to retrieve columns from |
$column | string | name of column, null to show all columns |
$full | boolean | whether to return full info or only column names |
return | string |
public function getColumnsSql($database, $table, $column = null, $full = false)
{
$sql = 'SHOW ' . ($full ? 'FULL' : '') . ' COLUMNS FROM ' . Util::backquote($database) . '.' . Util::backquote($table) . ($column !== null ? "LIKE '" . $GLOBALS['dbi']->escapeString($column) . "'" : '');
return $sql;
}