[feature/system-cron] Adjust SQL query style to follow coding guidelines.

PHPBB3-9596
This commit is contained in:
Andreas Fischer 2010-12-16 02:59:38 +01:00 committed by Oleg Pudeyev
parent 6235957aa1
commit 6fc11184e7
2 changed files with 6 additions and 3 deletions

View file

@ -50,7 +50,8 @@ class phpbb_cron_lock
$sql = 'UPDATE ' . CONFIG_TABLE . " $sql = 'UPDATE ' . CONFIG_TABLE . "
SET config_value = '" . $db->sql_escape($this->cron_id) . "' SET config_value = '" . $db->sql_escape($this->cron_id) . "'
WHERE config_name = 'cron_lock' AND config_value = '" . $db->sql_escape($config['cron_lock']) . "'"; WHERE config_name = 'cron_lock'
AND config_value = '" . $db->sql_escape($config['cron_lock']) . "'";
$db->sql_query($sql); $db->sql_query($sql);
// another cron process altered the table between script start and UPDATE query so exit // another cron process altered the table between script start and UPDATE query so exit
@ -73,7 +74,8 @@ class phpbb_cron_lock
$sql = 'UPDATE ' . CONFIG_TABLE . " $sql = 'UPDATE ' . CONFIG_TABLE . "
SET config_value = '0' SET config_value = '0'
WHERE config_name = 'cron_lock' AND config_value = '" . $db->sql_escape($this->cron_id) . "'"; WHERE config_name = 'cron_lock'
AND config_value = '" . $db->sql_escape($this->cron_id) . "'";
$db->sql_query($sql); $db->sql_query($sql);
} }
} }

View file

@ -40,7 +40,8 @@ class phpbb_cron_task_core_prune_all_forums extends phpbb_cron_task_base
$sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, forum_flags, prune_freq $sql = 'SELECT forum_id, prune_next, enable_prune, prune_days, prune_viewed, forum_flags, prune_freq
FROM ' . FORUMS_TABLE . " FROM ' . FORUMS_TABLE . "
WHERE enable_prune = 1 and prune_next < " . time(); WHERE enable_prune = 1
AND prune_next < " . time();
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {