I'm busy with a voting script but, I've a problem when I want to vote something, I receive an error:
Fatal error: Call to a member function query() on a non-object in
on Line 7
<?php
include '../config.php';
function getAllVotes($id)
{
$votes = array();
if($q_13 = "SELECT * FROM post WHERE id = $id");
if($r_26 = $db->query($q_13));
?>
And this is my config.php
<?php
$db = new mysqli('localhost', 'root', 'mysql', 'me');
if($db->connect_errno) {
die('Sorry, we are having some problems.');
}
?>