I have a ban list database system that holds the Rule type(category) and then a specific rule for it.
I have multiple rules with the same rule type name, but I cannot figure out how to make my website display both sets of rules for the category, underneath the Name header of the rule type.
Example: I have two categories:
- Ban rules.
- Conduct rules.
but my ban rules has 2 rows in my database and I cannot figure out how to display them both in a list format underneath the title "Ban Rules".
<?php
$sql = "SELECT * FROM minecraft";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
if(mysql_num_rows($result) > 0 ) {
echo "<div class='row'>";
echo "<div class='col-lg-12'>";
echo "<ul style='background-color:transparent;' class='list-group-item'>";
echo "Rules:";
echo "</ul>";
}
while($row = mysql_fetch_array($result)) {
echo "<div class='row'>";
echo "<div class='col-lg-12'>";
echo "<li style='background-color:transparent;' class='list-group-item'>";
echo $row['rule_type'];
echo "</li>";
//I need this one to produce two results underneath the 'Rule Type header on my list, but it only gives me one of the two results i need!//'
echo "<li style='background-color:transparent;' class='list-group-item'>";
echo $row['rule'];
$row['rule'](2);
echo "</li>";
}