Hi Mate,
Thanks for the code, i will do it the way you were saying in future, this code is doing my head in lol here is what i have now using your code:
PHP Code:
$id = mysql_escape_string(trim($_GET['id']));
if (empty($id)) { die('Error, no profile selected'); }
// Get Profile
$query = "select * from `membership` where `id`='$id' limit 1";
$result = mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result)==1)
{
$row = mysql_fetch_array($result);
extract($row); echo '<strong>Viewing '.$username.'īs Profile </strong>';
echo '<p>Email: '.$email.'<br>
Last Login: '.$login.'<br>
Joined: '.$join_date.'<br>.';
if ($status=='N')
{
echo 'Status: pending</p>';
}
else
{ echo 'Status: active</p>'; }
// Check Comments
$query2 = mysql_query("select * from `member_comments` where `mid`='$id2'") or die(mysql_error());
$id2 = $id;
$count_comments = mysql_num_rows($query2);
$form = '<form action="comment_post.php" method="POST">
<textarea name="comments" cols="20" rows="2">
</textarea> <input type="hidden" name="mid" value="'.$id2.'">
<input type="submit" value="Add Comment">
</form>'; // check that the comment view area is needed.
if ($count_comments != '0') {
echo $form;
} else {
}
while ($row2=mysql_fetch_array($query2)) {
$id2_com = $row2[id];
$quick_name = mysql_query("SELECT * FROM `membership` WHERE `id`='$row2[uid]' LIMIT 1") or die (mysql_error());
while ($n=mysql_fetch_array($quick_name)){
$mem_name = $n["username"];
}
echo '<hr />';
echo 'Posted By: <a href="view_profile.php?id='.$row2[uid].'">'.$mem_name.'</a><br>';
echo 'On: '.$row2[posted].'<br>';
echo 'Comment: '.$row2[comments].'<br><br>';
echo '<hr />';
}
echo $form;
}
it still only shows up the textare and not the message, it'll be somethin really simple no doubt lol
thank for the help mate
Graham
Bookmarks