I'm trying to convert some code over to mysqli from my sql but getting the error:
Fatal error: Call to a member function fetch_assoc() on a non-object in /home/prod/public_html/das
hp on line 8
Not sure what I'm doing wrong, just trying to pull the count number. Below is my code.
$sql1 = "select count(p.id) as projecttotal from projects p inner join projectassoc pa on p.id = pa.project_id where pa.user_id = $userid";
$result1 = $db->query($sql1);
$row1 = $result1->fetch_assoc();