I'm trying to figure this out. I have a message board where a user can comment on news and every time somebody does that all involved in that certain discussion recieves an email, an have allmost figured it out...
$sql1="SELECT * FROM ".$prefix."_clubnews WHERE newsid='$newsid'";
$result1 = mysql_query($sql1);
$row1 = mysql_fetch_array($result1);
$newsadmin = $row1['userid'];
$sql2="SELECT * FROM ".$prefix."_clubnews_comments WHERE newsid='$newsid'";
$result2 = mysql_query($sql2);
while($row2 = mysql_fetch_array($result2)){
$newsedit = $row2['userid'];
static $array = array();
if(!in_array($newsedit, $array)){
$array[] = $newsedit;
This looks through the table and only counts a user in a specific discussion once, but...
The origon news is in another table, so the topstory is in one table (clubnews) and all the comments is in another table (clubnews_comments).
Now if a user has posted a topstory, and also has commented on that story later on, that user will be counted twice... How do I get the (clubnews) table into the other array... Hope this makes sence?!?