//
function check_table($pref, $table, $field=null, $properties=null)
{
- $fields = @db_query("SHOW COLUMNS FROM ".$pref.$table);
- if (!$fields)
+ $tables = @db_query("SHOW TABLES LIKE '".$pref.$table."'");
+ if (!db_num_rows($tables))
return 1; // no such table or error
+ $fields = @db_query("SHOW COLUMNS FROM ".$pref.$table);
if (!isset($field))
return 0; // table exists
global $path_to_root, $installers;
$inst = $installers[$index];
- $sql = $inst->sql;
$pref = $conn['tbpref'];
$ret = true;
$state = $inst->installed($pref);
if (!$state || $force)
{
- if (!$inst->pre_check($pref)) return false;
+ if (!$inst->pre_check($pref, $force)) return false;
+ $sql = $inst->sql;
if ($sql != '')
$ret &= db_import($path_to_root.'/sql/'.$sql, $conn, $force);