Jump to content

MySql colum problem


Axel

Recommended Posts

I got a strange problem with inserting in a MySql table some data:

function addText(thePlayer, commandName, ...) 
    if (exports.global:isPlayerLeadAdmin(thePlayer)) then 
        if ( ... ) then 
                local text = table.concat({...}, " ") 
                local x, y, z = getElementPosition(thePlayer) 
                local interior = getElementInterior(thePlayer) 
                local dimension = getElementDimension(thePlayer) 
                local id = SmallestID() 
                local query = mysql:query_free("INSERT INTO 3dtext SET id=" .. mysql:escape_string(id) .. ", text=" .. mysql:escape_string(tostring(text)) .. ", x="  .. mysql:escape_string(x) .. ", y=" .. mysql:escape_string(y) .. ", z=" .. mysql:escape_string(z) .. ", interior=" .. mysql:escape_string(interior) .. ", dimension=" .. mysql:escape_string(dimension)) 
                if (query) and (text) then 
                        local pickup = createPickup(x, y, z, 3, 1239, 0) 
                        exports.pool:allocateElement(pickup) 
                        setElementDimension(pickup, interior) 
                        setElementDimension(pickup, dimension) 
                        exports['[ro]armour']:changeProtectedElementDataEx(pickup, "message", text) 
                        exports['[ro]armour']:changeProtectedElementDataEx(pickup, "dbid", id, false) 
                        outputChatBox("Textul a fost creat ID #" .. id .. ".", thePlayer, 0, 255, 0) 
                else 
                        outputChatBox("Eroare nr. 2001 - Reportaza pe forum.", thePlayer, 255, 0, 0) 
                end 
            else 
            outputChatBox( "Syntax: /" .. commandName .. " [text]", player, 255, 255, 255 )  
        end      
    end 
end 
addCommandHandler("addtext", addText, false, false) 

INFO:MYSQL ERROR 1054:Unkown colum "test text" in 'field list'

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...