Is there a way to echo this only once and not have it repeat?
- by Fernando
I have the following query:
$select = mysql_query("SELECT * FROM posts WHERE id = $postIds");
while ($return = mysql_fetch_assoc($select)) {
$postUrl = $return['url'];
$postTitle = $return['title'];
echo "<h1><a href='$postUrl'>".$postTitle."</a></h1>";
}
Now the problem is, the variable $postIds often times contain the same id multiple times. So the title of the post echos itself multiple times. Is there a way to have it echo only once?