0
I’m new to the subject and ended up stuck in the web.
I would like a help to display/search Postgresql database information and show on a web page.
As I am learning Python, I would like help in this language, but JS would also be interesting to me.
I have a Python file that makes the connection and a SELECT. Python file works right, via terminal. This is a base code that, from this code, I made my own
cur.execute("SELECT id, name, address, salary from COMPANY")
rows = cur.fetchall()
for row in rows:
print "ID = ", row[0]
print "NAME = ", row[1]
print "ADDRESS = ", row[2]
print "SALARY = ", row[3], "\n"
print "Operation done successfully";
cur = conn.cursor()
cur.execute("SELECT id, name, address, salary from COMPANY")
rows = cur.fetchall()
for row in rows:
print "ID = ", row[0]
print "NAME = ", row[1]
print "ADDRESS = ", row[2]
print "SALARY = ", row[3], "\n"
print "Operation done successfully";
conn.close()