#!/usr/bin/python3
'''script that lists all states from the database hbtn_0e_0_usa:
'''
import MySQLdb
import sys

if __name__ == "__main__":
    db = MySQLdb.connect(
        host='localhost',
        port=3306,
        user=sys.argv[1],
        passwd=sys.argv[2],
        db=sys.argv[3],
        )
    '''
        use cursor to make queries
    '''
    query = 'SELECT * FROM states ORDER BY id ASC'
    cursor = db.cursor()
    cursor.execute(query)
    results = cursor.fetchall()
    for row in results:
        print(row)
