MyBB Community Forums

Full Version: I made this PHP function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I made this PHP funtion.
But it doesn't seems to work.

Here is the code:
<?php

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'accepttos.php');

require_once "./global.php";

if(!$mybb->user['uid'] > 0) {

$db->update_query('users', 'toscheck=\'100\'', 'uid='.intval($mybb->user['uid']));

}

    echo '<META HTTP-EQUIV="Refresh" Content="0; URL=javascript:history.go(-1)">';    
    exit; 
?>

It should put in the number "100" into the current users table.

But when I check it the table is still empty. Any idea?
<?php

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'accepttos.php');

require_once "./global.php";

if($mybb->user['uid'] != 0) {

$db->update_query('users', array('toscheck' => 100), 'uid='.intval($mybb->user['uid']));

}
//...