milos83 Posted March 30, 2009 Share Posted March 30, 2009 (edited) Hi guys! Recently I start using _SQLite and I dont know much about sql databases.So I am complete noob...dont flame me for the Q I used ini like a database. My log was written in a INI file, but problem is that when INI get larger, IniWrite become too slow. Is there a way to code _SQLite to work like INI files... i manage to create the database, write, read from it... so i have: _SQLite_Exec($dbn, "CREATE TABLE datas (section1,text);") How to create keys and values under that section1? And offcourse how to retrive it. I tryed SQLite tutorials but no help there for me Much thanx in advance Edited March 30, 2009 by milos83 Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 30, 2009 Share Posted March 30, 2009 Hi guys! Recently I start using _SQLite and I dont know much about sql databases.So I am complete noob...dont flame me for the Q I used ini like a database. My log was written in a INI file, but problem is that when INI get larger, IniWrite become too slow. Is there a way to code _SQLite to work like INI files... i manage to create the database, write, read from it... so i have: _SQLite_Exec($dbn, "CREATE TABLE datas (section1,text);") How to create keys and values under that section1? And offcourse how to retrive it. I tryed SQLite tutorials but no help there for me Much thanx in advance I would create one log.dat file, create a separate table for each "section", then have at least two fields for the entries, i.e. "TimeStamp" and "Text". So you would have something like: _SQLite_Exec($dbn, "CREATE TABLE Section1 (Index PRIMARY,TimeStamp TEXT,Entry TEXT);") _SQLite_Exec($dbn, "CREATE TABLE Section2 (Index PRIMARY,TimeStamp TEXT,Entry TEXT);") _SQLite_Exec($dbn, "CREATE TABLE Section3 (Index PRIMARY,TimeStamp TEXT,Entry TEXT);") ; Add entry to section 2 _SQLite_Exec($dbn, "Insert INTO Section2 (TimeStamp,Entry) VALUES (" & _NowCalc() & ",'This is my entry, with text.');") The Index field gives you an automatic integer index for every entry, and the TimeStamp and Entry fields give you the standard log entry info. Play with the example scripts in the help file for the various _SQLite* functions. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
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