i am trying to select 2 values from 2 different tables and getting this error. when i only selected from 1 table its worked. this is my code (after changing it already when looking on answers to this problem n line):
$apartmentNum = $_GET['apartmentNumber'];
$getBillsSumQuery = "SELECT a.totalBillsAmount , b.count(id) FROM apartments AS a , bills AS b WHERE a.number = "'.$apartmentNum.'" AND b.apartmentNumber = '.$apartmentNum.'";
$totalSum = mysqli_query($con,$getBillsSumQuery);
$row = mysqli_fetch_assoc($totalSum); //this is where the program crushes
$newSum = $row['totalBillsAmount'];
$billsCount = $row['count(id)'];
echo '{"billSum":' . $newSum . ' , "billCount":' . $billsCount .'}';