Hello.
Can I insert multiply rows in single query?
This query works fine in mysqloo (remote MySQL server), but doesn't work with sv.db (sql.Query)
[CODE]
local query = "INSERT INTO uc_maps (id, title, gamemode) VALUES (1, 'cs_assault', 1), (2, 'cs_compound', 1),(3, 'cs_havana', 1),(4, 'cs_italy', 1),(5, 'cs_militia', 1),(6, 'cs_office', 1),(7, 'de_aztec', 1),(8, 'de_cbble', 1),(9, 'de_chateau', 1),(10, 'de_dust', 1),(11, 'de_dust2', 1),(12, 'de_inferno', 1),(13, 'de_nuke', 1),(14, 'de_piranesi', 1),(15, 'de_port', 1),(16, 'de_prodigy', 1),(17, 'de_tides', 1),(18, 'de_train', 1),(19, 'gm_bigcity', 1),(20, 'gm_construct', 1),(21, 'gm_flatgrass', 1),(22, 'rp_evocity_v33x', 1),(23, 'rp_evocity_v4b1', 1),(24, 'starfish_island', 1),(25, 'test_hardware', 1),(26, 'test_speakers', 1),(27, 'ttt_67thway_v7', 1),(28, 'ttt_alt_borders_b13', 1),(29, 'ttt_starfish_island_v1_2', 1)"
local db = mysqloo.connect( mysql_host, mysql_user, mysql_pass, mysql_db, mysql_port )
function db:onConnected()
local q = self:query(query)
function q:onSuccess()
print("Saved in MySQL") -- success
end
q:start()
end
db:connect()
sql.Query(query) -- near ",": syntax error
[/CODE]
Any ideas?
Don't store all your maps in a massive one-liner?
[QUOTE=Ott;48564698]Don't store all your maps in a massive one-liner?[/QUOTE]
u mean JSON?
[editline]29th August 2015[/editline]
Anyway i solved my problem.
It's SQLite. Another syntax
[URL="http://stackoverflow.com/questions/1609637/is-it-possible-to-insert-multiple-rows-at-a-time-in-an-sqlite-database"]http://stackoverflow.com/questions/1609637/is-it-possible-to-insert-multiple-rows-at-a-time-in-an-sqlite-database[/URL]
Sorry, you need to Log In to post a reply to this thread.