while ($row = $statement->fetchArray()) {
$typeMatches = Regex::compile('([a-z]+)\(([0-9]+)\)', Regex::CASE_INSENSITIVE)->match($row['Type']);
- $columns[] = array('name' => $row['Field'], 'data' => array(
+ $columns[] = array('name' => $row['Field'], 'data' => array(
'type' => $typeMatches[1],
'length' => $typeMatches[2],
'notNull' => (($row['Null'] == 'YES') ? true : false),
'default' => $row['Default'],
'autoIncrement' => ($row['Extra'] == 'auto_increment' ? true : false)
));
- }
+ }
return $columns;
}
$statement = $this->dbObj->prepareStatement($sql);
$statement->execute(array($tableName));
while ($row = $statement->fetchArray()) {
- $columns[] = array('name' => $row['attname'], 'data' => array(
+ $columns[] = array('name' => $row['attname'], 'data' => array(
'type' => $row['typname'],
'length' => $row['attlen'],
'notNull' => $row['attnotnull'],
'default' => $row['adsrc'],
'autoIncrement' => ($row['contype'] == 'p')
));
- }
+ }
return $columns;
}