I've searched a lot of basically the same questions on SO which haven't seemed to help. Been a while since i've touched php so i'm guessing there's a simple solution but really can't figure it out.
config.php: (included into admin.php)
$mysqli = new mysqli($mHost, $mUser, $mPass, $db);
admin.php:
$sqlQuery = "INSERT INTO `category` (`id`, `name`) VALUES ('', '$_POST[name]')";
$result = $mysqli->query($sqlQuery);
var_dump($result) returns:
NULL
and gives error:
Fatal error: Call to a member function query() on a non-object in