Jump to content

idris

Member
  • Content Count

    3
  • Joined

  • Last visited

  • Medals

Posts posted by idris


  1. 9:ADD_DATABASE_PROTOCOL:<DB_NAME>:SQL_RAW_V2:SQL1

    That way it doesn't add any quotes, but then you will need to add quotes to strings when you insert them into the database.

    But SQL_RAW is not recommended !!!! as you will need to sanitize the SQL Statements yourself in SQF (is extra work for server).

    Plus if a hacker got your server to remote execute code, and if they can guess SQL1 they could remote execute any SQL Statement on your Database.

    ----------

    It is highly recommended you use SQL_CUSTOM_V2, it is a small bit more hassle to setup.

    But it allows more control and is a lot more secure.

    Yeah, I was using SQL_RAW for testing purposes just to see what the output is. And I was going to parse the data through as stored procs. I will most likely switch to SQL_CUSTOM_V2 with your suggestion. Okay so I can use the protocol without ADD_QUOTES and then add the quotes to the elements without Arma thinking they are variable names?


  2. I am using extDB2 as the SQL base for a lifemission mod/mission I am making. I have come across an issue where I need to set a certain array, for this example I will just name it s_array, so I need to set s_array the same value as the column s_array_column in my database so I did the whole 2:SQL1:SELECT s_array FROM playerdata WHERE p_UID = <p_UID>(NOTE: SQL1 = 9:ADD_DATABASE_PROTOCOL:<DB_NAME>:SQL_RAW_V2:SQL1:ADD_QUOTES) , in the s_array_column it's got a value of ["string"] but it's outputting "[string]" so SQF thinks string inside the array is a variable and breaking. I also have another column for inventory where the items are setup as the following : [["itemname",2],["anotheritem",56]] so I'm wondering when it gets to that point it's probably going to break again.

    tl;dr is there a way to turn the elements in a returned array into a string and element[0] inside of an array inside of a master array a string as well?

    Regards,

    Idris.

    P.S. sorry if this is the wrong place to post this question I cannot make new threads for some reason.

×