@pie... it's not i don't like the query, but it's badly written:
PHP Code:
$pmquery=$DB_site->query("SELECT* FROM " . TABLE_PREFIX . "pmWHEREpmid='$pm'");
have to be
PHP Code:
$pmquery=$DB_site->query("SELECT * FROM " . TABLE_PREFIX . "pm WHERE pmid='$pm'");
that's all... they are all the same, missing some spaces between elements... easy to see anyway, the code will not work if you don't add the spaces...