Ho provato così
Codice PHP:
function Topic_lettura($id, $partireda, $x_pagina)
{
$sql ='SELECT u.*, t.*, m.*
FROM messaggi m
INNER JOIN topics t ON m.id_titolo=t.id
INNER JOIN utenti u ON (m.id_utente=u.id)
WHERE t.id= \''.$id.'\'
ORDER BY m.data_inserimento
LIMIT\''.$partireda.',\''.$x_pagina.'\'';
$result = $this->db_query($sql);
return $result;
ma da errore You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''0,'3'' at line 7