Synax error on db.close()
<p>Im trying to use mysqldb in a python script.</p>

<p>Here is a part of the code from the script</p>

<pre><code>cursor = db.cursor()

    sql = """INSERT INTO location(`name`, `lat`, `long`, `guid`, `image`, `date`)VALUES(%(name)s, %(lat)s, %(long)s, %(guid)s, %(image)s, %(date)s)"""

    try:
        cursor.execute(sql)
        db.commit()

db.close()
</code></pre>

<p>Im gettig a error on the db.close()</p>

<p>"db.close()
     ^
    SyntaxError: invalid syntax"</p>

<p>So any suggestions here?</p>