I am trying to style my output data, but I do not know how exactly do this.
My code looks like this:
$Sql99 = "SELECT Cat_Name, Cat_Id, COUNT(Product_Id) AS itemcount FROM tabproducts
INNER JOIN tabcats ON tabproducts.Cat_Id = tabcats.Cat_Id
GROUP BY tabproducts.Cat_Id ORDER BY itemcount DESC LIMIT 0,4";
$Query99 = mysql_query($Sql99, $Conn);
while($Rs99 = mysql_fetch_array($Query99)){
$cats .= "<li><a href=\"\">".$Rs99["Cat_Name"]."</a></li>"; //this is fine
$Sql08 = "SELECT tabproducts.*
FROM tabproducts
WHERE tabproducts.Cat_Id = '".$Rs99["Cat_Id"]."' ORDER BY Product_Id DESC
LIMIT 0,5";
$Query08 = mysql_query($Sql08, $Conn) or die(mysql_error());
while($Rs08 = mysql_fetch_array($Query08)){
//OUTPUT
}
}
My problem is on the second select the information I am try do output should look like this:
<div>
<ul class="home-listagem-empresas"> //categorie 1
<li>
<h1>".$Rs08["Product_Name"]."</h1>
</li>
<li>
<h1>".$Rs08["Product_Name"]."</h1>
</li>
</ul>
</div>
<div>
<ul class="home-listagem-empresas"> //categorie 2
<li>
<h1>".$Rs08["Product_Name"]."</h1>
</li>
<li>
<h1>".$Rs08["Product_Name"]."</h1>
</li>
</ul>
</div>
<div>
<ul class="home-listagem-empresas"> //categorie 3
<li>
<h1>".$Rs08["Product_Name"]."</h1>
</li>
<li>
<h1>".$Rs08["Product_Name"]."</h1>
</li>
</ul>
</div>
<div>
<ul class="home-listagem-empresas"> //categorie 4
<li>
<h1>".$Rs08["Product_Name"]."</h1>
</li>
<li>
<h1>".$Rs08["Product_Name"]."</h1>
</li>
</ul>
</div>
Each ul with the li's will represent the results from the 4 categories.
Sorry if I cannot explain it well, my English is not very good.