Jump to content

SQ Delete Error..


Recommended Posts

I keep getting an error for the executeSQLDelete() when I try and call this script (nil value if I remember)

  
function deleteRecord (thePlayer, command, name) 
    selectedPlayer = getPlayerFromNick(name) 
    if (selectedPlayer) then 
    result = executeSQLSelect ( "ClassTable", "player, class, IP", "player = '"..name.."'" ) 
            if (not result) then 
                outputChatBox("Cannot find a record for this user in the Database.", thePlayer) 
            else 
                outputChatBox("Deleted Data Nick:"..result[1][1].." Class: "..result[1][2].." IP: "..result[1][3], thePlayer) 
                excuteSQLDelete("ClassTable", "player = '"..name.."'" ) 
            end 
        else 
        outputChatBox("Cannot find player, please check spelling and try again", thePlayer) 
    end 
end 
addCommandHandler("userdelete", deleteRecord, true, false) 
  

EDIT: Oh and I've setup the table here

  
connect = executeSQLCreateTable ( "ClassTable", "player TEXT, class TEXT, IP TEXT" ) 
if (connect == false) then 
     outputChatBox("Could not connect to DB") 
end 
  

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...