SELECT transactions.UserName, transactions.transactionDate, transactions.transactionType, transactions.transactionAmount, transactions.OpeningBalance, transactions.EndBalance, users.FirstName, transactions.transactionID FROM transactions, users WHERE users.UserName = transactions.UserName AND users.UserName =  $_SESSION (['MM_Username'
]) ORDER BY transactions.UserName, transactions.transactionID DESC

I am getting syntax error with this code. can anyone help please?

Hi, if you using this query in PHP then this value:

$_SESSION (['MM_Username'])

Must be:

{$_SESSION['MM_Username']}

Full query:

"SELECT transactions.UserName, transactions.transactionDate, transactions.transactionType, transactions.transactionAmount, transactions.OpeningBalance, transactions.EndBalance, users.FirstName, transactions.transactionID FROM transactions, users WHERE users.UserName = transactions.UserName AND users.UserName = {$_SESSION['MM_Username']} ORDER BY transactions.UserName, transactions.transactionID DESC"

Documentation: