1. Explain why this is dangerous code. How would you modify it to run safely? form = cgi.FieldStorage() acc = form.getfi

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

1. Explain why this is dangerous code. How would you modify it to run safely? form = cgi.FieldStorage() acc = form.getfi

Post by answerhappygod »

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.)
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply