Assuming that the ids are in ascending order try using this querys
- NEXT
$sql = "select * FROM app_get_account_inbox_funk where account_id=" . $this->account_id ." AND conversation_id>".$this->conversartion_id." order by conversation_id ASC LIMIT 1";
- PREVIOUS
$sql = "select * FROM app_get_account_inbox_funk where account_id=" . $this->account_id ." AND conversation_id<".$this->conversartion_id." order by conversation_id DESC LIMIT 1";
And in the case of the last/first message
- LAST
$sql = "select * FROM app_get_account_inbox_funk where account_id=" . $this->account_id ." order by conversation_id DESC LIMIT 1";
- FIRST
$sql = "select * FROM app_get_account_inbox_funk where account_id=" . $this->account_id ." order by conversation_id ASC LIMIT 1";