I leave the code
@app.route("/")
def getInicio():
conn=sqlite3.connect('datala.db')
c = conn.cursor()
row=c.execute('''SELECT * FROM servicio''')
resultado =c.fetchone()
print(resultado)
conn.close()
return "hola"
I leave the code
@app.route("/")
def getInicio():
conn=sqlite3.connect('datala.db')
c = conn.cursor()
row=c.execute('''SELECT * FROM servicio''')
resultado =c.fetchone()
print(resultado)
conn.close()
return "hola"
I tried your code (I modified it slightly) with a table of two columns:
import sqlite3
def getInicio():
conn=sqlite3.connect("baseTabla.db")
c = conn.cursor()
row=c.execute("SELECT * FROM tabla")
resultado =c.fetchall()
for res in resultado:
print(res)
conn.close()
getInicio()
And it works without problems. You could check that the data really is in the file.