// begin if: no upgrade failures; update the database version in the config table
if ( $upgrade_failures == 0 )
{
- $query = 'UPDATE `%s` ' .
- 'SET `value` = "%s" ' .
- 'WHERE `name` = "DatabaseVersion"';
-
+ $query = 'UPDATE %s SET value = "%s" WHERE name = "DatabaseVersion";';
+
$query = sprintf($query, sql_table('config'), $version);
upgrade_query($message, $query);
}
// get info for indices from database
$indices = array();
- $query = 'SHOW INDEX FROM `' . sql_table($table) . '`';
+ $query = 'SHOW INDEX FROM ' . sql_table($table);
$result = @mysql_query($query);
// begin loop: each result object
*/
function upgrade_checkIfTableExists($table)
{
- $query = 'SHOW TABLES LIKE `' . sql_table($table) . '`';
+ $query = 'SHOW TABLES LIKE ' . sql_table($table);
$result = @mysql_query($query);
// begin if: query executed successfully and one row was returned
*/
function upgrade_checkIfCVExists($value)
{
- $query = 'SELECT `name` FROM `' . sql_table('config') . '` WHERE `name` = "' . $value . '"';
+ $query = 'SELECT name FROM ' . sql_table('config') . ' WHERE name = "' . $value . '"';
$result = @mysql_query($query);
// begin if: query executed successfully and one row was returned
*/
function upgrade_checkIfColumnExists($table, $column)
{
- $query = 'DESC `' . sql_table($table) . '` `' . $column . '`';
+ $query = 'DESC ' . sql_table($table) . ' ' . $column;
$result = @mysql_query($query);
// begin if: query executed successfully and one row was returned