Guest User

Untitled

a guest
Jun 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. if(mysql_num_rows($aResult) > 0)
  2. {
  3.  
  4. while($aRow = mysql_fetch_array($aResult))
  5. {
  6. $articles[$count] = array (
  7. "articleId" => $aRow["articleId"],
  8. "title" => $aRow["title"],
  9. "summary" => $aRow["summary"],
  10. "url" => $aRow["url"]
  11. );
  12. $count++;
  13. }
  14. else(sizeof($articles) == 0 ) {
  15. echo "No results found for '$search_keywords'<br>";
  16. echo "<a href='search.php'>Go Back</a>";
  17. }
  18. }
  19. if(sizeof($articles) > 0)
  20. {
  21. $articles = array_unique($articles);
  22. echo '<div align="center"><font color="purple">';
  23. echo "<h1>" . sizeof($articles);
  24. echo (sizeof($articles) == 1 ? " Item(s)" : " Item(s)");
  25. echo " found:</h1>";
  26.  
  27. foreach($articles as $a => $value)
  28. {
  29. ?>
  30. <a href="<?=$articles[$a]["url"]?> " target="mainframe">
  31. <b><u><?php echo $articles[$a]["title"]; ?></u></b>
  32. </a>
  33. <br><?php echo $articles[$a]["summary"] . "..."; ?>
  34. <br>
  35. <a href="<?=$articles[$a]["url"]?>" target="mainframe">
  36. <?=$articles[$a]["url"]?></a>
  37. <br><br>
  38. <?php
  39. }
  40. }
  41. ?>
Add Comment
Please, Sign In to add comment