Ask coding questions

← Back to all posts
I would like help getting a sqlite db up and running
NathanTodd2 (18)

i need help getting a sqlite db running for MyBB i got the sqlite executable tools on the server but i do not know how to use the sqlite tools

AarjavKavathia (5)

You can use python or PHP to connect to an sqlite database. You can create a .db file (name it whatever you want)
With python you do:
import sqlite3
conn = sqlite3.connect('yourdatabase.db')
c = conn.cursor()
If you know SQL then you can use c.execute() to run Sql commands like this:
c.execute('CREATE TABLE IF NOT EXISTS Record (Age TEXT, Name TEXT)')
After you update or change something in the database use conn.commit() to save everything.
After you're completely finished then just close the connection with conn.close().