Advertisement
kremisoski

Need To Condense To One Query :(

Aug 1st, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.45 KB | None | 0 0
  1. <?php foreach($query1 as $res1) : ?>
  2. <?php
  3. $months = $res1['month'];
  4. $years = $res1['year'];
  5. $month = date("F", mktime(0,0,0, $months, 10));
  6. $year = date("Y", mktime(0,0,0, $years, 10));
  7. ?>
  8. <h1><?=$month;?></h1>
  9.     <?php foreach ($query2 as $res2) : ?>
  10.         <?php if ($res2["month"] == $res1["month"]) : ?>
  11.             <h2><?=$res2["date"];?></h2>
  12.             <h3><?=$res2["title"];?></h3>
  13.         <?php endif; ?>
  14.     <?php endforeach; ?>
  15. <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement