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?
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.
ixjf Posted January 12, 2014 Posted January 12, 2014 You can format strings in Lua with string.format.
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