1
For example, I have a database called 123, in this database is the players table, which is where the players' accounts are. I want to count how many accounts there are in the database.
Finally, count the number of Rows from an SQLITE3 table, using PYTHON 2.7.
What I got so far:
# -*- coding: cp1252 -*-
import sqlite3
# Connexion for database
try:
print "Tentando conectar-se ao banco de dados."
Database, Cursor = None, None
Database = sqlite3.connect("./database/database.db", check_same_thread = False)
Database.text_factory = str
Database.isolation_level = None
Database.row_factory = sqlite3.Row
Cursor = Database.cursor()
print "Conectado com o banco de dados.\n"
except:
print "[ERROR] Falha na conexão do banco de dados."
Cursor.("?")
Okay, what do you already have of code so far? Have you managed to connect to the database with Python? Gave any error? You know SQL?
– Woss
Att: Codico att I have connection, no errors in connection. =/
– Luan pedro
What about SQL? You know how a query is made with SQL?
– Woss
I know very little about SQL, more know yes Delete, update, insert values in tables. Query also.
– Luan pedro
Try to run the query:
select count(*) from jogadores
– Woss