ReGo Posted December 30, 2014 Share Posted December 30, 2014 -- new clothing stuff values.id = exports.mysql:query_insert_free("INSERT INTO clothing (skin, url, description, price) VALUES (" .. tonumber(values.skin) .. ", '" .. exports.mysql:escape_string(values.url) .. "', '" .. exports.mysql:escape_string(values.description) .. "', " .. tonumber(values.price) .. ")") if values.id then savedClothing[values.id] = values outputChatBox('Drēbes pievienotas ar ID ' .. values.id .. '.', client, 0, 255, 0) else outputChatBox('Neizdevās pievienot drēbes.', client, 255, 0, 0) end else -- old clothing stuff local existing = savedClothing[values.id] if existing then if exports.mysql:query_free('UPDATE clothing SET skin = ' .. tonumber(values.skin) .. ', description = "' .. exports.mysql:escape_string(values.description) .. '", price = ' .. tonumber(values.price) .. ' WHERE id = ' .. tonumber(values.id)) then outputChatBox('Apģērbs saglabats.', client, 0, 255, 0) existing.skin = tonumber(values.skin) existing.description = tostring(values.description) existing.price = tonumber(values.price) else outputChatBox('Apģērbs netika saglabāts.', client, 255, 0, 0) end else outputChatBox('Neizdevās atrast apģērbus.', client, 255, 0, 0) end end end end, false) Link to comment
manve1 Posted December 31, 2014 Share Posted December 31, 2014 By the title I guess you took the script from somewhere as you don't have database and you are trying to handle database functions. Correct me if I am 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