Code: Select all
$query = "SELECT article.article_id, article.category_id, subscription.user_id FROM subscription, article WHERE subscription.category_id = article.category_id";
$query_result =mysql_query($query);
while ($row = mysql_fetch_array($query_result))
{
$query2 = "SELECT * FROM newsletter WHERE article_id = '".$row['article_id']."' AND user_id = '".$row['user_id']."'";
$query_result2 =mysql_query($query2);
while ($row1 = mysql_fetch_array($query_result2))
{
foreach ($row1 as $rows)
{
if ($rows['article_id']==$row['article_id'])
echo "no new update!<br/>";
...
else if ($rows['article_id']!=$row['article_id'])
echo "new updates available!<br/>";
...
}
}
}
can any1 tell me how i can achieve what i want. i believe this part should be modified:
Code: Select all
foreach ($row1 as $rows)
{
if ($rows['article_id']==$row['article_id'])
echo "no new update!<br/>";
...
else if ($rows['article_id']!=$row['article_id'])
echo "new updates available!<br/>";
...
}