Query works flawlessly on MySQL (phpmyadmin) but not in qa_db_read_one_value(qa_db_query_sub())
$userranking = qa_db_read_one_value(
qa_db_query_sub('
SET @row_number = 0;
SELECT
(@row_number:=@row_number + 1) AS num
FROM
`^userpoints`
WHERE userid = #
ORDER BY points DESC
', $userid)
);
What am I missing? Is the @ sign a problem?
PS: My goal is to get the user ranking based on the user points. Maybe there is another way too?