Sorry, but what the hell is this Code supposed to to?
A table privatemessage doesn't even exist in vBulletin (not in 3.0 and not in 3.5).
I can only assume you want to show the amount of total/unread PMs.
Then you don't need any of the Queries:
PHP Code:
if ($vbulletin->userinfo['userid'])
{
echo "Welcome: <b>{$vbulletin->userinfo['username']}</b> - <a href=\"http://www.ispreview.co.uk/talk/private.php\" target=\"_parent\">New Messages</a>: <b>{$vbulletin->userinfo['pmunread']} ({$vbulletin->userinfo['pmtotal']} Total)</b></font></center></TR></TD>
<TR><TD><IMG SRC=\"../../images/hr1.gif\" width=\"434\" height=\"1\" border=\"0\"></TD></TR>";
}
else
{
echo "Welcome: <i>Please <a href=\"talk/register.php\" target=\"_parent\">REGISTER</a> to use our Forum/Review systems</i></font></center></TR></TD>
<TR><TD><IMG SRC=\"../../images/hr1.gif\" width=\"434\" height=\"1\" border=\"0\"></TD></TR>";
}