Cosa c'è di sbagliato qui?
$rsh = mysql_query("SELECT to,from,id,message FROM chat WHERE from='$email' AND to='$email' ORDER BY id DESC");
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 'to,from,id,message FROM chat WHERE from='xxxx' AND to='xxxx' at line 1