(tablename,props)
return result
获取单条数据的信息
获取单条数据的信息
获取单条数据的信息
def GetOneRecordInfo(tablename,props):
    '''获取单条数据的信息
    '''
    props = FormatCondition(props)
    sql = """Select * from `%s` where %s;"""%(tablename,props)
    conn = dbpool.connection(write=False,tablename=tablename)
    cursor = conn.cursor(cursorclass = DictCursor)
    cursor.execute(sql)
    result = cursor.fetchone()
    cursor.close()
    conn.close()
    return result
def GetOneRecordInfo ( tablename , props ) : props = FormatCondition ( props ) sql = """Select * from `%s` where %s;""" % ( tablename , props ) conn = dbpool . connection ( write = False , tablename = tablename ) cursor = conn . cursor ( cursorclass = DictCursor ) cursor . execute ( sql ) result = cursor . fetchone ( ) cursor . close ( ) conn . close ( ) return result