Home>

I'm writing code to operate SQLite in Unity. Therefore, if you send the query for adding data below, you can add data with the upper string without any problem, but if you use the lower string interpolation
I get the error SqliteException: near "playername": syntax error.
Do you know what's wrong?

"insert into" + table.ToString () + "values ​​('"+ playerDTO.PlayerName + "'," + (int) playerDTO.JOB + "," + playerDTO.HP + "," + playerDTO.MP + "," + playerDTO .STR + "," + playerDTO.DEF + "," + playerDTO.AGI + "," + playerDTO.LUCK + ",'"+ playerDTO.CreateDay + "')";
$"insert into {table.ToString ()} values ​​('' {playerDTO.PlayerName}'', {(int) playerDTO.JOB}, {playerDTO.HP}, {playerDTO.MP}, {playerDTO.STR}, {playerDTO.DEF}, {playerDTO.AGI}, {playerDTO.LUCK},''{playerDTO.CreateDay}'') ";