git-svn-id: file:///svn/phpbb/trunk@7858 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2007-07-10 03:59:08 +00:00
parent 020debce66
commit 4fa1a7c827

View file

@ -965,19 +965,19 @@ function column_exists($dbms, $table, $column_name)
WHERE type = 'table' WHERE type = 'table'
AND name = '{$table}'"; AND name = '{$table}'";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$result) if (!$result)
{ {
return false; return false;
} }
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
preg_match('#\((.*)\)#s', $row['sql'], $matches); preg_match('#\((.*)\)#s', $row['sql'], $matches);
$cols = trim($matches[1]); $cols = trim($matches[1]);
$col_array = preg_split('/,(?![\s\w]+\))/m', $cols); $col_array = preg_split('/,(?![\s\w]+\))/m', $cols);
$column_list = array();
foreach ($col_array as $declaration) foreach ($col_array as $declaration)
{ {