Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import psycopg2
- # print "Content-type: text\html"
- # print
- conn = psycopg2.connect("dbname='dbafa'user='postgres'host='localhost'password='postgres'");
- cur = conn.cursor()
- cur.execute("insert into usuarios (nome_usuario, email_usuario, senha_usuario, cpf_usuario, cargo, nivel_permissao) values (%s, %s, %s, %s, %s, %s)", (us.pega_nome_usuario(),us.pega_email(),us.pega_senha(),us.pega_cpf(),us.pega_cargo(),us.pega_nivel_permissao()))
- # Make the changes to the database persistent
- conn.commit()
- cur.execute("select * from usuarios")
- print(cur.fetchall())
- cur.close()
- conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement