$query = "
SELECT count( USER_ID ) AS cnt,USER_ID
FROM ubbt_PRIVATE_MESSAGE_USERS
GROUP BY USER_ID
";
$sti = $dbh->do_query($query,__LINE__,__FILE__);
while (list($total_PM,$PM_UserId) = $dbh -> fetch_array($sti)) {
$query = "
update {$config['TABLE_PREFIX']}USER_PROFILE
set USER_PM_TOTALS = ?
where USER_ID = ?
";
$dbh->do_placeholder_query($query,array($total_PM,$PM_UserId),__LINE__,__FILE__);