I get this error, I tried going through other similar threads but it didn\'t help.
here is php
$host = \"http://www.domain.com\";
$hostname = \"local
Syntax mysqli_fetch_assoc is:
array mysqli_fetch_assoc ( mysqli_result $result )
Try (for PHP >=5.4):
$hits = mysqli_fetch_assoc($result)['hits'];
From the codes, I see that you want to UPDATE the final records from hits.
$hitquery = "SELECT * FROM $userstable where url = '$url'";
$result = mysqli_query($con, $hitquery);
while(null !== ($hits= mysqli_fetch_assoc($result))) {
$query2 = "UPDATE $userstable SET `hits` = hits+1 where url = '$url'";
}