diff --git a/PgDB.py b/PgDB.py index 5720d67..7136fe9 100644 --- a/PgDB.py +++ b/PgDB.py @@ -70,15 +70,18 @@ class PgDB(object): self.con.rollback() return False - def doSelect(self,sql): - cursor = self.con.cursor() - try: - cursor.execute(sql) - results = cursor.fetchall() - return results - except Exception: - logging.error(u'Error during SQL request "%s"', sql.decode('utf-8', 'ignore'), exc_info=1) - return False + def doSelect(self,sql,params): + cursor = self.con.cursor() + try: + if params is None: + cursor.execute(sql) + else: + cursor.execute(sql,params) + results = cursor.fetchall() + return results + except Exception: + logging.error(u'Error during SQL request "%s"', sql.decode('utf-8', 'ignore'), exc_info=1) + return False # # SQL helpers