![]() |
Sqlite help - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: General Help (/Forum-General-Help) +--- Thread: Sqlite help (/Thread-Sqlite-help) |
Sqlite help - azmanomer - 09-29-2015 08:10 AM I have tables for each accounts and i want to update their one column which are the same name "status" is it possibly to that with one command without for loop? If its not possible than another question is it possible to take a backup db when server save and restore db when i start the sphere? example; 1th question example i got "a,b,c,d,e,f,g,h,t,c" tables and they all have status column in sphere_serv_triggers.scp [FUNCTION f_onserver_save] ldb.connect if <ldb.connected> update all status to 1 where status 0 ---> is this possible? ldb.close endif 2th question example i got database called "spheredb" and "a,b,c,d,e,f,g,h,t,c" tables and they all have status column in sphere_serv_triggers.scp [FUNCTION f_onserver_save] ldb.connect if <ldb.connected> backup "spheredb" name it "spheredb_backup" ----> is this possible? ldb.close endif [FUNCTION f_onserver_start] ldb.connect if <ldb.connected> restore from "spheredb_backup" to "spheredb" ----> is this possible? ldb.close endif sorry for my english ![]() RE: Sqlite help - XuN - 09-29-2015 04:44 PM 1: 'UPDATE 'tablename' SET 'status' = x 2: Since SQlite databases are easily accessed in SphereSvr's folder you might want to think about creating a .rar or .zip, there is a backup script somewhere in the dowloads section for saves, you can adapt it for DB too. RE: Sqlite help - azmanomer - 09-29-2015 10:22 PM Yeah i used syscmd and created batch files to create backup and restore it i hope it wont give me any error in the future. Re: RE: Sqlite help - Extreme - 09-30-2015 08:30 AM (09-29-2015 10:22 PM)azmanomer Wrote: Yeah i used syscmd and created batch files to create backup and restore it i hope it wont give me any error in the future. Did it work? ![]() RE: Sqlite help - azmanomer - 09-30-2015 08:49 AM yep ![]() |