scienziato-pazzo Posted January 12, 2014 Posted January 12, 2014 Hi, I want to format a string with a custom value from another string. Usually on other languages, like C++, I saw %s, but how to do it on LUA?
Gallardo9944 Posted January 12, 2014 Posted January 12, 2014 do you mean string.gsub? Code Debugger - Minimalistic MTA debug line replacement
scienziato-pazzo Posted January 12, 2014 Author Posted January 12, 2014 I saw the "?" operator, and the "??" operator, but how it works?
scienziato-pazzo Posted January 12, 2014 Author Posted January 12, 2014 Yes, but for example here (https://wiki.multitheftauto.com/wiki/DbQuery) I saw the "?" and the "??", but how do they work?
TAPL Posted January 12, 2014 Posted January 12, 2014 This is just to make you able to put the string after the comma. So this: dbExec( connection, "UPDATE `??` SET `??`=?", tableName, columnName, columnValue ) Is the same as this: dbExec( connection, "UPDATE `tableName` SET `columnName`=columnValue" )
scienziato-pazzo Posted January 12, 2014 Author Posted January 12, 2014 Ooooh, thanks. But what's the difference between ?? and ?.
Castillo Posted January 12, 2014 Posted January 12, 2014 I think that "??" is used for column and table names and "?" is used for values. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
ixjf Posted January 12, 2014 Posted January 12, 2014 You can format strings in Lua with string.format. I used to know how to code, but then I took an arrow in the knee. Project Redivivus - Remaking Old School MTA With New Code MTA 0.6 Nightly 1 released
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