Таблица user - id_user, name, avatar, rating
Таблица message - id_message, text
Таблица связи user~message - id_user, id_message
Select `user`.`name`, `message`.`text` From `message` INNER JOIN `user` ON (`user`.`id_user` = `message`.`id_user`) Where `message`.`id_user` = 2