Jump to content

[MYSQL-QUERY] HELP


Recommended Posts

Hi guys.

I have this script :

 

local kill = mysql.query("SELECT p_kill FROM account.account WHERE id = (SELECT account_id FROM player.player WHERE name='"..pc.get_name().."');")[1][1]

notice_all("Punti ottenuti: "..kill.."")

 

When I run the script I get this error : attempt to concatenate global 'kill'  (a nil value) .

I created the table p_kill and I can run with success the query: 

mysql.query("UPDATE account.account SET p_kill = p_kill + 1 WHERE id = (SELECT account_id FROM player.player WHERE name='"..pc.get_name().."');")

What's the matter?

Sorry for my bad english.
                

Link to comment
Share on other sites

Sorry, my error.

I tried so (i have mysql.query | mysql.direct_query | mysql.update | mysql.real_escape_string | mysql.get_table_postfix in quest_function):

local kill = mysql.query("SELECT p_kill FROM account.account WHERE id = '"..pc.get_account_id().."'") 
 

but I get:

 

attempt to concatenate local 'kill' (a table value)

 

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.