Need Help MySQL syntax In Rank Function ! I am Using App Inventor Mysql.php Script

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

I get the rank in 000webhost Mysql Server

IT WORK IN Free Hosting Mysql Database But Not Work In Godaddy Mysql Database
I have get this error in Godday Mysql Database

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.

Thank you for showing some support on this topic as you tell i contact godday for what is the mysql version i have in my database .

Web Hosting - Linux

Component Version (Subversion)
Apache 2.4
cURL 7.19.7
PHP 5.2.17
5.3.3
Perl 5.10.1
Python 2.6.6
MySQL 5.0.96
phpMyAdmin 2.11.11.3
PEAR 1.3.2

Web Hosting - Windows

Component Version (Subversion)
IIS 7.0
ASP.NET 4.0, 4.5
cURL Web: 7.2 (PHP 5.2, 5.3), 7.3 (PHP 5.4)
Classic: 7.21 (not available on all accounts)
PHP 5.2.17, 5.3.6
MDAC 2.8
MS SQL 2008 R2, 2012

cPanel

Component Version (Subversion)
Apache 2.4.33
cURL 7.19.7
MySQL 5.6.39
PHP 5.6

7.0
7.1
7.2 (default)
7.3|
|PEAR|1.10.5|
|Perl|5.10.1|
|phpMyAdmin|4.7.7|
|Python|2.6.6|
|Zend|3.2.0|

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

1 Like

Which web hosting are you using? Linux or Windows?

i am Linux hosting also i am using App Inventor Mysql.php File

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;

You must adapt to your needs.

3 Likes

Thank You Sir For Your Support I am now trying your syntax if its work today you will be my god

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

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.