Hello Kodular i am facing some issue in MySQL syntax In Rank Function . I was Using this syntax in Free Hosting Server (000Webshot) It Work But right now i brought paid hosting from godaday all syntax are working fine but rank Function i am getting some error.
I have Search Many forum But could not get the result so ask in kodular i know that their so much talented person have
Here Is my Table
So I am Used this query For get the user rank
SELECT Name, Score, TimeLeft, ProfilePic,DENSE_RANK() OVER (ORDER BY Score DESC , TimeLeft DESC) AS Rank FROM Contest1
It’s not exactly a Kodular related post, but you can ask Godaddy what is the MySQL version and compare with your previous host… maybe they are not the same.
After, explain the situation to them, about your query.
but i put my effort Cloud not find the free hosting sever MySQL database Version. And I know this is not related to kudular thank you again for give some effort
Sorry I dont really not much About mysql database or php i just learning process
I am Now take help from godaddy They Said
This query of the syntax code issue you need review it for it for the reference click here
18:45, Oct 23
Neelesh : This may seem cryptic since it is a general error pointing to a syntax issue in the SQL Query
statement. Since the 1064 error can have multiple causes, we will go over the most common things that will
result in this error and show you how to fix them. Follow along so you can get your SQL queries updated and
running successfully.
18:46, Oct 23
Neelesh : Using reserved words, Missing Data, Mistyping of Commands
Obsolete Commands
18:47, Oct 23
Neelesh : The issue is not with the host it with the code,
18:47, Oct 23
You: ok.
18:48, Oct 23
You: But Why This Code is working on that 000webshot server
18:48, Oct 23
You: i am import the data from their
18:48, Oct 23
You: Database
18:49, Oct 23
Neelesh : Every host has their configuration we are using mysql 5.6.39 not sure about the other ho
Ok, as I can see, the MySQL version in this Linux hostin is 5.0.96 which does not support RANK function. That’s why you are having problems in your query.
If you keep using this server, I have a workaround for you, as a suggestion, to get you ranking working:
SELECT first_name,
age,
gender,
@curRank := @curRank + 1 AS rank
FROM person p, (SELECT @curRank := 0) r
ORDER BY age;
SELECT Name,
Score,
TimeLeft, @curRank := @curRank + 1 AS rank
FROM Contest1, (SELECT @curRank := 0) r
ORDER BY Score DESC;
I modify your Syntax according to my table .its working i am very happy really today is my best day solve my problem after 6 days of hard-work all credits goes to you sir