0
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?

2
Contributors
1
Reply
23
Views
3 Years
Discussion Span
Last Post by cereal
0

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:

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.