Axel Posted June 2, 2012 Share Posted June 2, 2012 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
Cyandie Posted June 2, 2012 Share Posted June 2, 2012 It cannot find the field name called "test text" in your mySQL database. Link to comment
Axel Posted June 2, 2012 Author Share Posted June 2, 2012 That's the point, when i'm using command: /addtext test text it says that.. and "test text" is every text i put.. Link to comment
Axel Posted June 2, 2012 Author Share Posted June 2, 2012 So what can be done? (sorry for double post) 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