• My SQL Error? (Nickname System)
    1 replies, posted
Hello Facepunch, Im having a problem i keep geting an error when trying to insert data to a database (internal one) saying "no such column: SteamID" and i dont know how to fix it I create the table on line 1 [LUA] sql.Query( "CREATE TABLE IF NOT EXISTS player_nicknames ( SteamID string, Nickname string )" ) [/LUA] And later on when i try this i get an error (one mentioned above) [LUA] sql.Query( "INSERT INTO player_nicknames ( SteamID, Nickname ) VALUES ( SteamID = "..sql.SQLStr(ply:SteamID())..", Nickname = "..sql.SQLStr(ply:Nick()).." )" ) print("Done INSERT: "..sql.LastError()) [/LUA] Exact console print is [CODE] Done INSERT: no such column: SteamID [/CODE] PS: The table/column is there, [IMG]http://i.gyazo.com/b6f19eca0153ea161913aa9571abb9e4.png[/IMG] [editline]11th July 2015[/editline] Anyone? Please. Any ideas? At all.
bump [editline]11th July 2015[/editline] OMG i fixed it, it was so simple. (I hate SQL) [LUA] sql.Query( "INSERT INTO player_nicknames ( SteamID, Nickname ) VALUES ( SteamID = "..sql.SQLStr(ply:SteamID())..", Nickname = "..sql.SQLStr(ply:Nick()).." )" ) [/LUA]
Sorry, you need to Log In to post a reply to this thread.