Member Avatar for sundeep.gurroby
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:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.