I am working on a leaderboard. The leaderboard gets data from my SQL Database. It is using the old method of MySQL because I'm not familiar with MySQLi yet.
I don't want to add a row everytime, so I'm using a php method to repeat it. But I got a issue with it. It is returning nothing what I've put in the echo.
This is my complete code: https://gist.github.com/matthijs110/accb1b0b69570c4d3f50
It looks fine to me, and I can't find any errors. The result of the current code looks like this:
About the warning: I don't know why and how it came there, It says the problem is this line:
if (mysql_num_rows($result)) {
I've used that if check multiple times on other pages without any issues.
What is wrong?
TABLE_NAMEshould be a variable instead of a constant?SELECT Username, Wins FROM theTableName ORDER BY Wins DESCand see how you go.echo mysql_error($db);to see the error. BTW Stop usingmysql_*functions, they are deprecated and insecure. Usemysqli_*instead.