2010-06-19, 09:15 PM
Hello,
i'm using MyBB: 1.4.13 and i'm trying to create the fallowing custom task
ac_validate it's in the same database as MyBB database but i can't run the query since MyBB ads the TABLE_PREFIX automatically.
Any ideeas how can I solve this?
The exact error message i'm getting, so you can make an ideea.
Thank you for your time.
i'm using MyBB: 1.4.13 and i'm trying to create the fallowing custom task
<?php
/**
* MyBB 1.4
* Copyright © 2008 MyBB Group, All Rights Reserved
*
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*
* $Id: inactiveaccounts.php 4304 2010-06-19 23:11:56Z ADN $
*/
function task_inactiveaccounts($task)
{
global $db, $lang;
// Delete old inactive accounts
$db->delete_query("`ac_validate` WHERE DATE_SUB(CURDATE(),INTERVAL 3 DAY) > joindate;");
add_task_log($task, $lang->task_inactiveaccounts_ran);
}
?>
ac_validate it's in the same database as MyBB database but i can't run the query since MyBB ads the TABLE_PREFIX automatically.
Any ideeas how can I solve this?
The exact error message i'm getting, so you can make an ideea.
SQL Error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE DATE_SUB(CURDATE(),INTERVAL 3 DAY) > joindate' at line 2
Query:
DELETE FROM bb_`ac_validate` WHERE DATE_SUB(CURDATE(),INTERVAL 3 DAY) > joindate;
Thank you for your time.