public getColumnStmt ( string $tableName ) : string | ||
$tableName | string | Name of table to get columns |
Результат | string | SQL sentence with columns |
function getColumnStmt($tableName)
{
$colStmt = array();
foreach ($this->tableColumnTypes[$tableName] as $colName => $colType) {
if ($colType['type'] == 'bit' && $this->dumpSettings['hex-blob']) {
$colStmt[] = "LPAD(HEX(`{$colName}`),2,'0') AS `{$colName}`";
} else {
if ($colType['is_blob'] && $this->dumpSettings['hex-blob']) {
$colStmt[] = "HEX(`{$colName}`) AS `{$colName}`";
} else {
$colStmt[] = "`{$colName}`";
}
}
}
$colStmt = implode($colStmt, ",");
return $colStmt;
}