<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <table width="620" border="1"> <tr> <td width="130">Product Name </td> <td width="143">Product Type</td> </tr> <tr> <td>Coated </td> <td>Silk</td> </tr> <tr> <td></td> <td>Gloss </td> </tr> <tr> <td></td> <td>Cast Coated </td> </tr> <tr> <td></td> <td>Matt </td> </tr> <tr> <td></td> <td> Part Mechanical </td> </tr> <tr> <td></td> <td> Gloss Digital </td> </tr> <tr> <td></td> <td> Silk Digital </td> </tr> <tr> <td></td> <td> Gloss One Sided </td> </tr> </table> </body> </html>
<?phpinclude "config.php";$query= "select jos_list.*,jos_list_categories.title as maincat from jos_list,jos_list_categories where jos_list.category_id=jos_list_categories.id and jos_list_categories.id='43'"; $result = mysql_query($query);echo "<table border=\"1\" align=\"center\">";echo "<tr><th>Product Name</th>";echo "<th>Produt Type</th></tr>";while ($row = mysql_fetch_array($result)){ $cat[$row['maincat']] = $row['maincat'] ; echo "<tr>"; foreach($cat as $kk=>$vv) { echo '<td>'.$kk.'</td>'; } echo "</td><td>"; echo $row['title']; echo "</td></tr>";}echo "</table>";?>