That query was just supposed to tell me if there were messages with a wrong id_topic...but apparently there isn't any, so the content of those two tables should be correct.
Okay, out of curiosity:
SELECT id_topic, id_board
FROM smf_topics
WHERE id_topic IN (4, 18, 122, 188, 234, 260, 262, 353, 369, 378, 403, 413, 433, 710, 733, 739, 762, 798, 880)
SELECT id_msg, id_topic, id_board
FROM smf_messages
WHERE id_topic IN (4, 18, 122, 188, 234, 260, 262, 353, 369, 378, 403, 413, 433, 710, 733, 739, 762, 798, 880)