I'm trying to figure out a problem I'm having with a SELECT MAX()
command. I want to gather the highest value in the 'BidAmount' column, but I only want selected entries to be scanned for the highest value.
For example, I want the highest 'BidAmount' to be returned where another column 'UserID' = 6. I want to know the highest 'BidAmount' for a specific customer (so the column 'UserID' will equal '6').
I tried using this:
SELECT MAX(`BidAmount`) FROM `requests` WHERE `UserID` = 6
But it doesn't work. If the above SQL code should work, it might be a problem with my PHP. What shall I do?