i have written two queries for two data, which will fetch data from two databases and show the output as data of the database, but it is taking one and for another it is showing Undefined property: stdClass::$totals,
need to solve this
Here is my two sql queries
$sql = "select MONTHNAME (created_at) as mname, SUM(amount) as total from monthly_cash_in
where MONTH(created_at)=MONTH(now())
and YEAR(created_at)=YEAR(now()) and ins_name='$name'" ;
$result = $conn->query($sql);
$sql1 = "select MONTHNAME (created_at) as mname, SUM(amount) as totals from monthly_cash_out
where MONTH(created_at)=MONTH(now())
and YEAR(created_at)=YEAR(now()) and ins_name='$name'";
$result1 = $conn->query($sql1);