1. Explain why this is dangerous code. How would you modify itto run safely? form = cgi.FieldStorage() acc =form.getfirst('accession') qry = "SELECT * FROM gene WHEREaccession = '{0}'".format(acc) curs.execute(qry)
2. It is said you should 'clean up your connections' beforeending your python scripts that connect to a database. What methodsdoes this mean you should remember to call? (hint: think about yourconnection and cursor.)
1. Explain why this is dangerous code. How would you modify it to run safely? form = cgi.FieldStorage() acc = form.getfi
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am