MyBB Community Forums

Full Version: Call to undefined method MysqliDb::insert_query()
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What I have to do here to make it query ? I have this script test.php in public folder/test/test.php

So the path to require_once "../global.php"; is ../

<?php

define("IN_MYBB", 1);
define('THIS_SCRIPT', 'test.php');
require_once "../global.php";
require_once "../inc/init.php";

require_once ('include/functions.php');
require_once ('include/MysqliDb.php');
require_once ('config.php');


global $db;

if (isset($_GET['act']) && _notEmpty($_GET['act']))
{
 $action = strtolower($_GET['act']);
 $db = new MysqliDb ($db_host, $db_username, $db_password, $db_name);


 if (isset($_POST['username'], $_POST['password'], $_POST['uuid']))
 {
 $username = $_POST['username'];
 $pass = $_POST['password'];
 $uuid = $_POST['uuid'];

 // only if isset becouse old version does not have
 if (isset($_POST['ipaddress'])){
 $ip = $_POST['ipaddress']; 
 }

 
 $stats = array(
 "uid" => NULL,
 "uname" => $username,
 "ip" => $ip,
 "date" => NULL
 ); 

 $query = $db->insert_query("loginstats", $stats); 



 
 }

 
}

Are you still looking for an answer, if so, do you mean hook to your test page?