Afisare pe coloane date din baza de date
Scris: Mar Apr 23, 2013
Cum pot face sami afiseze pe patru coloane produsele?
Am incercat cu codul acesta :
Si-mi arata in urmatorul fel (adresa imagine):
img593.imageshack.us/img593/8343/82656094.png
Am incercat cu codul acesta :
Cod: Selectaţi tot
$sql = mysql_query("SELECT * FROM magazin_online WHERE id and bucatii != '0'");
echo "<table>";
while($mag =mysql_fetch_array($sql)){
$id = $mag['id'];
$titlu = $mag['produs_title'];
$desc = $mag['produs_desc'];
$sql_img_select = "SELECT * FROM store_magazin_online_image WHERE produs_id = '$id'";
$sql_img_select_res = mysql_query($sql_img_select) or die(mysql_error());
$img_mag_sel = mysql_fetch_array($sql_img_select_res);
echo "<tr><td><ul class=\"thumbnails\">
<li class=\"span3\">
<div class=\"thumbnail\">
<img data-src=\"holder.js/300x200\" src=\"./upload/".$img_mag_sel['produs_image']."\" alt=\"\">
<h3><a href=\"./magazin.php?id=".$id."&produs_title=".$titlu."\">".$titlu."</a></h3>
<p>".substr($desc, 0, 100)."</p>
<a href=\"./magazin.php?id=".$id."&produs_title=".$titlu."\" class=\"btn btn-primary\">Detalii</a> <a href=\"./magazin.php?id=".$id."&produs_title=".$titlu."\" class=\"btn\">Specificati Comanda</a>
</div>
</li>
</ul></td></tr>";
}
echo "</table>";
img593.imageshack.us/img593/8343/82656094.png