(self,sql)
return result
u'执行 SELECT 语句
u'执行 SELECT 语句
u 执行 SELECT 语句
def query(self,sql):
      u'执行 SELECT 语句'  
      try:
        self._cur.execute("SET NAMES utf8") 
        result = self._cur.execute(sql)
      except MySQLdb.Error, e:
        self.error_code = e.args[0]
        print "数据库错误代码:",e.args[0],e.args[1]
        result = False
      return result
def query ( self , sql ) : try : self . _cur . execute ( "SET NAMES utf8" ) result = self . _cur . execute ( sql ) except MySQLdb . Error , e : self . error_code = e . args [ 0 ] print "数据库错误代码:",e.args[0],e.a r g s [1] result = False return result