dawid4157 Posted August 8, 2014 Share Posted August 8, 2014 Why this function does not work? function zapytanie(player) local playerName = getPlayerName(player) local register = mysql_query(handler, "INSERT INTO `Players` SET `Nick` = ".. playerName .." ") outputChatBox("Poprawne zapytanie") end When I set this: function zapytanie(player) local playerName = getPlayerName(player) local register = mysql_query(handler, "INSERT INTO `Players` SET `Nick` = 'dawid4157' ") outputChatBox("Poprawne zapytanie") end code work good. Why? How use getPlayerName correctly? Please help. Link to comment
Wei Posted August 8, 2014 Share Posted August 8, 2014 function zapytanie(player) local playerName = getPlayerName(player) local register = mysql_query(handler, "INSERT INTO `Players` SET `Nick` = `".. playerName .."` ") outputChatBox("Poprawne zapytanie") end Try this Link to comment
dawid4157 Posted August 8, 2014 Author Share Posted August 8, 2014 It`s not work. Maybe oher concept? Link to comment
Anubhav Posted August 8, 2014 Share Posted August 8, 2014 function zapytanie(player) local playerName = getPlayerName(player) local register = mysql_query(handler, "INSERT INTO `Players` SET `Nick`=? ", playerName ) outputChatBox("Poprawne zapytanie") end Link to comment
dawid4157 Posted August 8, 2014 Author Share Posted August 8, 2014 I show all code: local host = 'host' local user = 'user' local password = 'pass' local db = 'database' handler = mysql_connect(host, user, password, db) if (handler) then outputChatBox("Connected to the Database!", getRootElement(), 255, 000, 000) outputDebugString("Connected to the Database!") else outputChatBox("No connected to the Database!") outputDebugString("No connected to the Database!") end function zapytanie(player) local playerName = getPlayerName(player) local register = mysql_query(handler, "INSERT INTO `Gracze` SET `Nick`=? ", playerName ) outputChatBox("Poprawne zapytanie") end addCommandHandler("sql", zapytanie) What is wrong? Link to comment
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