I have the following code:
<?
include"mysql.php";
$getusers= mysqli_query ("select count(*) as cnt from users",$c);
$totalusers= mysqli_fetch_array ($getusers);
$totalusers=$totalusers['cnt'];
$getusers= mysqli_query ("select * from users",$c);
$totalmoney=0;
while($usr= mysqli_fetch_array ($getusers))
{
$totalmoney=$totalmoney+$usr['total_earned'];
}
$getoffers= mysqli_query ("select count(*) as cnt from offers where active=1",$c);
$ocnt= mysqli_fetch_array ($getoffers);
$ocnt=$ocnt['cnt'];
print"<p>Total Offers: $ocnt<br>Total Members: $totalusers<br>Total Earned: \$$totalmoney</p>";
?>
still it gives me this error:
Warning: mysqli_query() expects parameter 1 to be mysqli, string given in /home/u705139137/public_html/header.php on line 48
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/u705139137/public_html/header.php on line 49
Warning: mysqli_query() expects parameter 1 to be mysqli, string given in /home/u705139137/public_html/header.php on line 51
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/u705139137/public_html/header.php on line 53
Warning: mysqli_query() expects parameter 1 to be mysqli, string given in /home/u705139137/public_html/header.php on line 57
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/u705139137/public_html/header.php on line 58
What have I done wrong?