"; if (1==1) { // Show # of unseen articles in each journal: $db_name = "journals"; $table_name = "article"; $connection = @mysql_connect("localhost","birgit","mpathg12") or die("could not connect"); $db = @mysql_select_db($db_name, $connection) or die("could not select database"); $sql = "select distinct journal from article ORDER BY journal"; $result=@mysql_query($sql,$connection) or die("could not execute query"); while ($row=mysql_fetch_array($result)) { $journal = $row['journal']; //$sql2 = "select COUNT(*) AS Unseen from article left outer join review ON article.Article_ID=review.Article_ID AND review.Username=\"$username\" WHERE review.Article_ID IS NULL AND article.Journal=\"$journal\""; $sql2 = "select COUNT(*) AS Unseen from article left outer join review ON article.Article_ID=review.Article_ID WHERE review.Article_ID IS NULL AND article.Journal=\"$journal\""; $result2=@mysql_query($sql2,$connection) or die("could not execute query2"); $row2=mysql_fetch_array($result2); $Unseen=$row2['Unseen']; $sql3 = "select Add_Date from article where Journal=\"$journal\" order by Add_Date DESC limit 1;"; $result3=@mysql_query($sql3,$connection) or die("could not execute query3"); $row3=mysql_fetch_array($result3); $Last=$row3['Add_Date']; echo "$Unseen unseen articles in $journal (last update "; $days = floor((strtotime("now") - strtotime("$Last"))/86400); if ($days > 31) { echo "$days"; } else echo "$days"; echo " days ago)
"; } } // end if (1==0) } ?>