I seem to have run into another problem which I can not seem to figure out. I get an error on 2 lines. the errors are:
Warning:
mysqli_query()
expects parameter 1 to bemysqli
, object given inC:\xampp\htdocs\page.php
on line 72Warning:
mysqli_fetch_row()
expects parameter 1 to bemysqli_result
, null given inC:\xampp\htdocs\page.php
on line 73
The main part of the code I am using and which are the problem are as follows:
require('includes/config.php');
$sql = "SELECT avatar FROM members WHERE username='$username' LIMIT 1";
$query = mysqli_query($db, $sql);
$row = mysqli_fetch_row($query);
I can't see why this would produce an error?