It also took me a while to figure the sqlite thing out, But once you get the hang of it, it's a great tool. There was a need for another level of wrapping in order to make it more GLBasic friendly. I've done that to make it easier for myself to use. I've included an example that has my wrapper functions. I hope you find it useful.
// --------------------------------- //
// Project: sqlite-test00
// Description: a test of sqlite
// --------------------------------- //
GLOBAL SQL AS SQLITE //sqllite wrapper
GLOBAL fields$[]
DIM fields$[5] //number of fields in database
LOCAL recordcount
DBInit("myfriends.db") //set database name
DBSetDebug(FALSE) //log file = GLBSqLite.debug
//Set database fields
fields$[0] = "NAME"
fields$[1] = "COUNTRY"
fields$[2] = "EMAIL"
fields$[3] = "PHONE"
fields$[4] = "BIRTHDAY"
//Drop table if it exists
DBExecute("drop table info;")
//Create table named 'info' from fields$[] array
DBCreateTable("info")
//Add friends to the database
DBExecute("insert into info (NAME, COUNTRY, EMAIL, PHONE, BIRTHDAY) values ('Abraham','Israel','abe@is.is','12345678','6 February');")
DBExecute("insert into info (NAME, COUNTRY, EMAIL, PHONE, BIRTHDAY) values ('Ivan','Ukraine','ivan@ukuks','12345678','7 February');")
DBExecute("insert into info (NAME, COUNTRY, EMAIL, PHONE, BIRTHDAY) values ('Scotty','Scotland','scotabe@sc.sc','12345678','8 February');")
DBExecute("insert into info (NAME, COUNTRY, EMAIL, PHONE, BIRTHDAY) values ('Spock','Vulcan','spock@vu.vu','12345678','9 February');")
DBExecute("insert into info (NAME, COUNTRY, EMAIL, PHONE, BIRTHDAY) values ('Jim','Starbase','jum@sb.sb','12345678','10 February');")
//Do a database query on all friends
recordcount = DBQuery("select * from info;")
//read all the retieved records - reuse the fields$ array for the data
FOR i% = 0 TO recordcount-1 //for each record retrieved
DBRead(i,fields$[]) //read the record into the fields array
FOR j% = 0 TO LEN(fields$)-1 //for each field in the record
DEBUG fields$[j]+" " //display the data
NEXT
DEBUG "\n"
NEXT
END
//---------------------------------------------------------------------
//Reads a retrieved database record
//---------------------------------------------------------------------
FUNCTION DBRead: record%, array$[]
LOCAL s$,_data$[]
s$ = SQL.DBgetRecord$(record)
SPLITSTR(s$,_data$[],";")
FOR i% = 0 TO LEN(_data$)-1
array$[i] = _data$[i]
NEXT
ENDFUNCTION
//---------------------------------------------------------------------
//Query the database - returns number of records found
//---------------------------------------------------------------------
FUNCTION DBQuery: query$
SQL.DBdoSql(query$)
RETURN SQL.DBgetRecordcount()
ENDFUNCTION
//---------------------------------------------------------------------
//Execute a sql command
//---------------------------------------------------------------------
FUNCTION DBExecute: command$
SQL.DBdoSql(command$)
ENDFUNCTION
//---------------------------------------------------------------------
//Create databse table from field$ array
//---------------------------------------------------------------------
FUNCTION DBCreateTable: tableName$
LOCAL s$ = "create table " + tableName$ + "("
FOR i% = 0 TO LEN(fields$)-1
s$ = s$ + fields$[i]+" text"
IF i < LEN(fields$)-1 THEN s$ = s$ + ", "
NEXT
s$ = s$ + ");"
SQL.DBdoSql(s$)
ENDFUNCTION
//---------------------------------------------------------------------
//Initialize the database - open in with a database name
//---------------------------------------------------------------------
FUNCTION DBInit: databaseName$
SQL.DBSetName(databaseName$)
ENDFUNCTION
//---------------------------------------------------------------------
//Set the dabase debugging on or off
//---------------------------------------------------------------------
FUNCTION DBSetDebug: state
IF state
SQL.DBdebugOn()
ELSE
SQL.DBdebugOff()
ENDIF
ENDFUNCTION