Note that there are some explanatory texts on larger screens.

plurals
  1. POOutput By Month With Only One Header
    text
    copied!<p>I've been trying to take this from my current output to a 'by month' output. I'm about to pull all of my hair out on this one. What I'm trying to do is group the games in months. So <code>January, feb march</code> ect would have each games underneath it. Right now I have to do this for every team and create a static <code>placeholder</code> and new variables for each.</p> <p>DATABASE STRUCTURE</p> <pre><code>[id] [opponent] [month] [team] [notes] [date_added] [buyLink] [time] [date] &lt;?php // Check to see the URL variable is set and that it exists in the database // Connect to the `MySQL` database include "../../includes/db_conx.php"; //-------------------------------------------------------------------------------------- $sqlcountRam = "SELECT * FROM discounts WHERE team='cyoram' ORDER BY date ASC"; $sql_countRam = mysqli_query($db_conx,$sqlcountRam); $calCountRam = mysqli_num_rows($sql_countRam); //-------------------------------------------------------------------------------------- if ($calCountRam &gt; 0) { // get all the product details $x=0; while($row = mysqli_fetch_assoc($sql_countRam)){ $id = $row["id"]; $opponent = $row["opponent"]; $team = $row["team"]; $notes = $row["notes"]; $month = $row["month"]; $buyLink = $row["buyLink"]; $time = $row["time"]; $date = $row["date"]; $formatted_date = date("l d F Y H:i A", strtotime($date)); $raw = "$formatted_date"; $xplod = explode(' ',$raw); /*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ include "includes/logos.php"; /*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/ $classCssRam = "inline-block"; $x++; $classChangeRam = ($x%2 == 0)? 'whiteBackground': 'grayBackground'; $product_listRam .= " &lt;div class='aNew' style='clear:both;display:&lt;?php echo $classCssRam; ?&gt;'&gt; &lt;div class='monthSalute'&gt;$month&lt;/div&gt; &lt;table width='400px' border='0'&gt; &lt;tr class='$classChange'&gt; &lt;td rowspan='2' class='date' &gt;$xplod[1]&lt;/td&gt; &lt;td class='day'&gt;$xplod[0]&lt;/td&gt; &lt;td rowspan='2' class='centerLogo'&gt;&lt;div class='containImgPos'&gt;&lt;img src='$imgLogo' height='32px' style='position:relative;left:$posImgR;' /&gt;&lt;/div&gt;&lt;/td&gt; &lt;td class='city'&gt;$city&lt;/td&gt; &lt;td rowspan='2' class='butt_pad'&gt;&lt;a href='calendar_edit.php?pid=$id'&gt;edit&lt;/a&gt; &amp;bull; &lt;a href='calendar_list.php?deleteid=$id'&gt;delete&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class='$classChangeRam'&gt; &lt;td class='time $classChangeRam'&gt;$time&lt;/td&gt; &lt;td class='opponent $classChangeRam'&gt;$opponent&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; "; } } else { $product_listRam = ""; $classCssRam = "none"; } ?&gt; </code></pre>
 

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