k first of all if your using plugins hooks are used to display the code on pages e.g forumhome_compete will execute at the bottom of the index.php file.
If your adding code, you will be using member_***
Next, you dont need to connect to the database, it is done automatically. Also you dont need the opening php tag or the closing one.
Finally I taken a bit of your code and changed it around to be more vbulletin compatible
PHP Code:
$counter = 0;
// Lets get the Recent Reviews
$queryz = $vbulletin->db->query_read("SELECT
rp_products.title,
rp_reviews.username,
rp_reviews.userid,
rp_reviews.review,
rp_reviews.cat,
rp_reviews.product,
rp_products.bigimage,
rp_products.cat,
rp_products.userid
FROM " . TABLE_PREFIX . "
rp_reviews
INNER JOIN rp_products ON (rp_reviews.product=rp_products.id)
WHERE
(rp_reviews.review IS NOT NULL) AND
(rp_products.approved = 1) AND
(rp_reviews.userid = {$vbulletin->GPC['userid']})
ORDER BY
rp_reviews.`date` DESC LIMIT 5");
// Printing results in HTML
echo "<div align=\"center\">\n";
echo "<table width=\"100%\">\n";
while ($row = $vbulletin->db->fetch_array($queryz)) {
$title = $row['title'];
$review = $row['review'];
$username = $row['username'];
$product = $row['product'];
$bigimage = $row['bigimage'];
$cat = $row['cat'];
}
Also it's better to use templates instead of echoing html. Chec the articles section for more help.
Hope that helps.