Advertisement
gitlez

Untitled

Jun 27th, 2011
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.09 KB | None | 0 0
  1. <?php
  2.  
  3. $find = "SELECT * FROM walls ORDER by wallrd DESC";
  4. $run = mysql_query($find);
  5. while ($is = mysql_fetch_assoc($run)){
  6.     $wallid = $is['wallid'];
  7.     $wallfn = $is['wallfn'];
  8.     $walloriginal = $is['walloriginal'];
  9.     $wallcaption = $is['wallcaption'];
  10.     $wallsmall = $is['wallsmall'];
  11.     $wallrd = $is['wallrd'];
  12.     $wallc = $is['wallc'];
  13.     $datelink = date("F Y", strtotime ($wallrd));
  14.     if(!isset($datelinks[$datelink])){
  15.         $datelinks[$datelink] = "<a href='archive.php' title='$wallrd'>$datelink</a><br />";
  16.     }
  17. }
  18. foreach ($datelinks as $row){
  19.     echo $row;
  20. };
  21.  
  22. // If the above while loop is all you are using the results for, then there is no need for the additional info.
  23. /*
  24. $run = mysql_query("SELECT wallrd FROM walls ORDER BY wallrd DESC");
  25. while($is = mysql_fetch_assoc($run)){
  26.     $wallrd = $is['wallrd'];
  27.     $datelink = date("F Y", strtotime($wallrd));
  28.     if(!isset($datelinks[$datelink])){
  29.         $datelinks[$datelink] = "<a href='archive.php' title='$wallrd'>$datelink</a><br />";
  30.     }
  31. }
  32. foreach($datelinks as $row){
  33.     echo $row;
  34. }
  35. */
  36. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement