Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Thanks for the all the help, everybody. By piecing together some of your suggestions and correcting some of the mistakes I overlooked, I was at long last able to get my desired results using the following code:</p> <pre><code> $dateQuery = mysql_query("SELECT DISTINCT month, day, year FROM Shows") or die(mysql_error()); $todayMonth = date(n); $todayDate = date(j); $todayYear = date(Y); while ($info = mysql_fetch_array($dateQuery)) { if ($todayMonth &lt;= $info['month'] &amp;&amp; $todayDate &lt;= $info['day'] &amp;&amp; $todayYear &lt;= $info['year']) { $showDate = date("F j, Y", mktime(0, 0, 0, $info['month'], $info['day'], $info['year'])); echo "&lt;b&gt;&lt;li&gt;$showDate&lt;/li&gt;&lt;/b&gt;"; $detailsQuery = mysql_query("SELECT * FROM Shows WHERE month = {$info['month']} AND day = {$info['day']} AND year = {$info['year']}") or die(mysql_error()); while ($concertInfo = mysql_fetch_array($detailsQuery)) { $concertDetails = $concertInfo['band'] . " @ " . $concertInfo['venue'] . " in " . $concertInfo['city'] . ", " . $concertInfo['state']; echo "&lt;li&gt;$concertDetails&lt;/li&gt;"; } } } </code></pre> <p>This successfully prints each unique date only once (the if loop) and subsequently prints each show associated with that date under it before moving on to the next date, like so:</p> <pre><code>December 9, 2011 Some Band @ The Crocodile Cafe in Seattle, WA Some Other Band @ Nectar Lounge in Seattle, WA December 15, 2011 and so on and so forth </code></pre> <p>Cheers!</p> <p>Shaun</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload