Im trying to use mysqldb in a python script.

Here is a part of the code from the script

```
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()

```

Im gettig a error on the db.close()

"db.close()
 ^
 SyntaxError: invalid syntax"

So any suggestions here?