Fix viewpart missing message bug

added `dbconn()` (which creates a db link) before using `mysql_real_escape_string`, otherwise a null string could be returned instead of an escaped message id