Change mysql_ call to use DBAPI