SQL Help

Hello, i want to save some data in a table this is what i got:

sql.Query(("INSERT INTO textentry_save( Entry1, Entry2, Entry3 )VALUES (%s, %s, %s) "):format(sql.SQLStr(textentry:GetValue()), sql.SQLStr(textentry2:GetValue()), sql.SQLStr(textentry3:GetValue())))

This is not working so i want to know if i done everything correct and there is just a error with somthing else.

I might be wrong, but isn’t it

.format not :format?

Again, could be very wrong.

edit: wording

string.format() if I’m not wrong.

There should be an error in most cases. Would be good to post it if you got one.

There is no error. Not on client not on server.

The use of “:format” is correct, as the string is being passed as the first argument.

string.format( “%s”, 10 ) is equivalent to ( “%s” ):format( 10 )

The query syntax is correct, and the Lua checks out. Consider looing into whether the SQL table(s) exist, or any other backend errors.

Try debugging that your SQL queries are even getting called, by running simple queries.

1 Like