sqlite

My HTML is not sending the POST method to the flask app function

My HTML is not sending the POST method to the flask app function Question: What’s happening: I have an HTML code that is sending a POST request to the flask code. It’s for a Login page. (I’m using SQLite3 and Flask.) The HTML code: <div class="col"> <div class="login-box"> <h2>Register</h2> <form method="post" action="{{ url_for(‘register_post’) }}"> <div …

Total answers: 1

python – split query results into multiple objects based on one column

python – split query results into multiple objects based on one column Question: my program is querying a sqlite database, and thre result is like this (simplified) in the cursor ready to be fetched. connection = sqlite3.connect(IMAGE_LOG_DB_PATH) connection.isolation_level = None cur = connection.cursor() sql_query = "Select date, name, count(*) as sells from sellers group by …

Total answers: 1

sqlite: error when using another sqlite command inside a custom function (sqlite3.Connection.create_function)

sqlite: error when using another sqlite command inside a custom function (sqlite3.Connection.create_function) Question: I’m learning to create custom sqlite3 functions in Python. This is my code: import sqlite3 conn = sqlite3.connect("data.db") c = conn.cursor() query = "CREATE TABLE IF NOT EXISTS names (ID INTEGER UNIQUE PRIMARY KEY NOT NULL, name TEXT)" c.execute(query) query = "INSERT …

Total answers: 1

SQLite: how to concatenate JOIN

SQLite: how to concatenate JOIN Question: I have three tables in my database, related to physical exercises: exercises(id, name) tags(id, name) exercises_tags(id_exercise, id_tag) The exercises_tags table stores which tags corresponds to which exercise. One exercise can have multiple tags. Example: exercises(id, name): (1, ‘squat’) tags(id, name) (1, ‘legs’) (2, ‘quads’) (3, triceps) exercises_tags(id_exercise, id_tag) (1, …

Total answers: 1

Counting distinct values across columns using sqlite3 in python

Counting distinct values across columns using sqlite3 in python Question: I’m trying to count distinct values across columns using sqlite3 in python but cant seem to get the correct results. Am only able to get the count of distinct values in 1 column. I’ve create a database and imported the csv file as a table …

Total answers: 4

Attempting to do detail validation on a db created in sqlite 3 using python

Attempting to do detail validation on a db created in sqlite 3 using python Question: I’m transitioning from keeping and checking login files on a text document to from a SQL database. In my current solution, I have got it working where I can check the file for the username and password and then report …

Total answers: 1

How to remove a specific column value from SQLite Row Object in Python

How to remove a specific column value from SQLite Row Object in Python Question: So, I am fetching a record from a table in SQLite but I don’t want to include the first column which is "id" and primary key in the table. But I can’t seem to achieve that. After fetching a row, I …

Total answers: 1

Weird result with sqlite in python

Weird result with sqlite in python Question: I’m trying to get a count of document where the email of my user appear, I’m doing this for every user so I use a loop which takes every email of my user that got a document (to avoid having people with 0 document). So I know for …

Total answers: 1

Flask SQLAlchemy created an instance folder?

Flask SQLAlchemy created an instance folder? Question: Flask app. I have a database using sqlite called market.db. I have configured it in my app.py like this: app.config[‘SQLALCHEMY_DATABASE_URI’] = ‘sqlite:///market.db’ Then when I run flask shell, it created a folder instance/. Then I ran db.create_all(), and that created a database inside of that instance/ folder. I …

Total answers: 2