Jump to content
  • 0
Aeromesi

escape_sql?

Question

Is escape_sql necessary when using the script command query_sql?

I think it has something to do with SQL Injection within scripts. Is it needed everytime you query and update a DB with new info? like would I put +escape_sql at the end of the query?

 

 

 

ex:

 

 

query_sql "SELECT `credits` FROM `cp_votes` WHERE `account_id` = "+getcharid(3)+"",@credits;
Edited by Aeromesi

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

For your example, no.

escape_sql is indeed necessary when you are trying to insert the string which is directly taken from the user... So that the user cannot do any other operations

Share this post


Link to post
Share on other sites
  • 0

basically:

 

use it for: strings like user input messages, user names, well, strings at all

do not use it for: numbers

 

and by the way in that case it doesn't go into the end of the query, but like this:

 

 

query_sql "SELECT `credits` FROM `cp_votes` WHERE `account_id` = '"+escape_sql(+getcharid(3))+"'"",@credits; 

Share this post


Link to post
Share on other sites
  • 0

Without escape_sql with an input in a db cant they gather the root user/pass?

Share this post


Link to post
Share on other sites
  • 0

Without escape_sql with an input in a db cant they gather the root user/pass?

 

they can do pretty much everything they want to, it is just a SQL injection

Share this post


Link to post
Share on other sites
  • 0

 

Without escape_sql with an input in a db cant they gather the root user/pass?

 

they can do pretty much everything they want to, it is just a SQL injection

Thank you guys for clarifying this! Much appreciated.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.