/**
* Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
- * Copyright (C) 2002-2009 The Nucleus Group
+ * Copyright (C) 2002-2012 The Nucleus Group
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
*/
/**
* @license http://nucleuscms.org/license.txt GNU General Public License
- * @copyright Copyright (C) 2002-2009 The Nucleus Group
+ * @copyright Copyright (C) 2002-2012 The Nucleus Group
* @version $Id: upgrade.functions.php 1889 2012-06-17 08:46:45Z sakamocchi $
*/
break;
}
- $result = DB::getResult($query);
- $installed = ( $result !== FALSE ) && ($result->rowCount() >= $minrows);
-
+ $result = mysql_query($query);
+ $installed = ( $result != 0 ) && (mysql_num_rows($result) >= $minrows);
+
return $installed;
}
echo "<li> $friendly — ";
# execute the query
- $result = @DB::execute($query);
+ $result = @mysql_query($query);
// begin if: error executing query
if ( $result === FALSE )
{
echo '<span class="warning"> FAILED </span> <br />';
- $err = DB::getError();
- echo 'Error: <code>', $err[2], '</code>';
+ echo 'Error: <code>', mysql_error(), '</code>';
$upgrade_failures++;
}
// else: query was successful
$indices = array();
$query = 'SHOW INDEX FROM ' . sql_table($table);
- $result = @DB::getResult($query);
+ $result = @mysql_query($query);
// begin loop: each result object
- foreach ( $result as $row )
+ while ( $object = mysql_fetch_object($result) )
{
// begin if: key has not been added to the indeces array yet
- if ( !isset($indices[$row['Key_name']]) )
+ if ( !isset($indices[$object->Key_name]) )
{
- $indices[$row['Key_name']] = array();
+ $indices[$object->Key_name] = array();
} // end if
- array_push($indices[$row['Key_name']], $row['Column_name']);
+ array_push($indices[$object->Key_name], $object->Column_name);
}
// compare each index with parameter
function upgrade_checkIfTableExists($table)
{
$query = 'SHOW TABLES LIKE ' . sql_table($table);
- $result = DB::getResult($query);
+ $result = @mysql_query($query);
// begin if: query executed successfully and one row was returned
- if ( ($result !== FALSE) && ($result->rowCount() == 1) )
+ if ( ($result !== FALSE) && (@mysql_num_rows($result) == 1) )
{
return TRUE;
}
function upgrade_checkIfCVExists($value)
{
$query = 'SELECT name FROM ' . sql_table('config') . ' WHERE name = "' . $value . '"';
- $result = DB::getResult($query);
+ $result = @mysql_query($query);
// begin if: query executed successfully and one row was returned
- if ( ($result !== FALSE) && ($result->rowCount() == 1) )
+ if ( ($result !== FALSE) && (@mysql_num_rows($result) == 1) )
{
return TRUE;
}
function upgrade_checkIfColumnExists($table, $column)
{
$query = 'DESC ' . sql_table($table) . ' ' . $column;
- $result = DB::getResult($query);
+ $result = @mysql_query($query);
// begin if: query executed successfully and one row was returned
- if ( ($result !== FALSE) && ($result->rowCount() == 1) )
+ if ( ($result !== FALSE) && (@mysql_num_rows($result) == 1) )
{
return TRUE;
}