Page 1 of 1

Google Charts records issue

Posted: 2021-01-21 20:27
by bruceholt
I am trying to add a Google chart to my homepage which I have managed to get working but it is showing data on the chart from every user.

I have tried to add a check to get the member ID but it is still showing every users data.

Code: Select all

<?php
$connection = mysqli_connect('localhost', 'root', '', 'farmrex');
$result = mysqli_query($connection, "SELECT
    DATE_FORMAT(expense_date, '%b') AS month,
    SUM(cost) AS total
FROM
    expenses
left join membership_userrecords on pkValue=expenses.id
WHERE
    expense_date > NOW() - INTERVAL 12 MONTH
	and memberID='".getLoggedMemberID()."'
GROUP BY
    YEAR(expense_date), MONTH(expense_date)");
//if($result){
//    echo "CONNECTED";
//}
?>