示例#1
0
    def find_row(self,columns="*",condition=None,limit=1):
        if condition == None:
            condition=""

        sql=tinysql.select(self.table,columns,condition,"",limit)
        print "sql,",sql
        ret=self.dbh.query(sql)
        return ret
示例#2
0
 def find_by_id(self,id,columns="*"):
     sql=tinysql.select(self.table,columns,"`%s`='%s'" % (self.primary_key,id))
     print "sql,",sql
     return self.dbh.fetchRows(sql)