MyBB Community Forums

Full Version: NOT WORKING | Task Manager, SQL Update Profile Field, +1 Increment
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am trying to get a working version of this but so far every time I attempt to make a test run of this by clicking "run task" it does not work.

Basically what the task is supposed to do is when run it should add +1 to any input of the field. So accounts that are at 54 when the task is run will then be 55. Its not working.

I've attached some screen shots of where it says it ran successfully, but its never logged nor does it actually go. I'm at a loss and starting to become frustrated.

Here is the PHP:
<?php
/**
* Author: Shinka
* Description: Task that, when ran, automatically adjusts all characters' ages
* based on current age, registration date, and current date.
*/
function task_age($task)
{
global $mybb, $db;
$INCREMENT = 1;
$query = $db->query("
   UPDATE ".TABLE_PREFIX."userfields userfields
   SET fid58 = CAST(fid58 as UNSIGNED) + {$INCREMENT};
");
add_task_log($task, "The age characters task successfully ran.");
}

Updated:
Gave a screen shot collage to hopefully give some idea of the issue I'm having right now. Also tried to explain the point of the task a bit more for those that may not understand.
Try this:

<?php
/**
* Author: Shinka
* Description: Task that, when ran, automatically adjusts all characters' ages
* based on current age, registration date, and current date.
*/
function task_age($task)
{
global $db;
$INCREMENT = 1;
$query = $db->query("
   UPDATE ".TABLE_PREFIX."userfields userfields
   SET fid58 = CAST(fid58 as UNSIGNED) + {$INCREMENT};
");
add_task_log($task, "The age characters task successfully ran.");
}
?>
Unfortunately it is still not working.
Are you sure? Just tested and it works fine.
Yeah its not working for me. Unless I've done some sort of setting wrong with the task manager area of the ACP, but when I click the run icon the next time to run time changes so it's like it worked but it never actually does and its not logged as ran successfully.