gokalpfirat Posted August 31, 2012 Share Posted August 31, 2012 database = mysql_connect( "localhost", "root", "ankara", "test1" ) -- connectDB if database then outputDebugString ('Connect') else outputDebugString ("Trouble") end result = mysql_query(database, "SELECT first_name, age, gender, @curRank := @curRank + 1 AS rank FROM person p, (SELECT @curRank := 0) r ORDER BY age; ") -- Execute the query if result then outputDebugString ('True') else outputDebugString ("False") end It always says True at debugscipt but when I look at mysql table it wont happens. (Note: When I execute this at phpmyadmin it works. But when i execute it at mta it wont.) Link to comment
scratcher911 Posted August 31, 2012 Share Posted August 31, 2012 I don't understand what you mean. SELECT means you can only get data not insert or something like this. It won't change anything in phpmyadmin. Link to comment
gokalpfirat Posted August 31, 2012 Author Share Posted August 31, 2012 The (SELECT @curRank := 0) part allows the variable initialization without requiring a separate SET command. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now