o.Raw("SELECT COUNT(*) AS `count` FROM `message` WHERE (`to_account` = ? OR `from_account` = ?) AND `timestamp` < ? AND `delete` = 0",uid,uid,timestamp).QueryRow(&messageCount)
_,err:=o.Raw("SELECT * FROM `message` WHERE (`to_account` = ? OR `from_account` = ?) AND `timestamp` < ? AND `delete` = 0 ORDER BY `timestamp` ASC LIMIT ?,?",uid,uid,timestamp,start,end).QueryRows(&messages)