Praticamenteper trooopo complicatoOriginariamente inviato da marketto
bisogna mettere il ciclo dentro un'altro ciclio...![]()
Grazie comunque
Praticamenteper trooopo complicatoOriginariamente inviato da marketto
bisogna mettere il ciclo dentro un'altro ciclio...![]()
Grazie comunque
MITTICCOOOOOOOOO!
questo è quello che ho fatto ioè compreso un pezzo per la paginazione...cmq dovrebbe funzionare cmq...) CIAO!!
![]()
![]()
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="269" height="129" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="11" colspan="3" valign="top">
<? $q_seltot="SELECT * FROM prodotti LEFT JOIN sottocategorie USING(sottocat_id) LEFT JOIN categorie USING(cat_id) WHERE categorie.cat_id='$cat_id' AND sottocategorie.sottocat_id='$sottocat_id'";
$r_seltot=mysql_query($q_seltot) or die ('Errore nella query');
$drtot=mysql_num_rows($r_seltot);//print $drtot;?>
<? $num_articoli=10;
$n=3;
$num_pag=ceil($drtot/$num_articoli);
//print $num_pag;
// $pagina_corrente= ceil(($g/$num_articoli)+1);
$current_page = (!$_GET['page']) ? 1 : (int)$_GET['page'];
$g=($current_page -1) * $num_articoli;
$q_sel="SELECT * FROM prodotti LEFT JOIN sottocategorie USING(sottocat_id) LEFT JOIN categorie USING(cat_id) WHERE categorie.cat_id='$cat_id' AND sottocategorie.sottocat_id='$sottocat_id' ORDER BY prodotti.prod_id LIMIT $g,5";
$r_sel=mysql_query($q_sel) or die ('Errore nella query');
while ($dr=mysql_fetch_assoc($r_sel)){ ?>
</td>
</tr>
<tr>
<td width="11" height="101"></td>
<td width="251" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="immagini/prodotti.gif">
<tr>
<td width="18" height="11"></td>
<td width="108"></td>
<td width="14"></td>
<td width="22"></td>
<td width="74"></td>
<td width="15"></td>
</tr>
<tr>
<td height="8"></td>
<td></td>
<td></td>
<td></td>
<td rowspan="5" valign="middle" align="center">[img]public/aq_img/aq_<? print($dr[prod_id]);?>_p.jpg[/img]</td>
<td></td>
</tr>
<tr>
<td height="43"></td>
<td rowspan="3" valign="middle"><font color="#FF6633" face="Arial, Helvetica, sans-serif" size="1"><? print($dr[sottocat_nome]);?></font>
<font color="#000000" face="Arial, Helvetica, sans-serif" size="1"><? print($dr[nome]);?></font></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="14"></td>
<td valign="top">[img]immagini/bottone_prod.jpg[/img]</td>
<td></td>
<td></td>
</tr>
<tr>
<td height="6"></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="3"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="16"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table></td>
<td width="7"></td>
</tr>
<tr>
<td colspan="3" height="10"></td>
</tr>
<? }?>
</table></td>
<td width="268" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="11" colspan="3" valign="top">
<? //print $g;
$g1=$g+5;
//print $g1;
$q_sel="SELECT * FROM prodotti LEFT JOIN sottocategorie USING(sottocat_id) LEFT JOIN categorie USING(cat_id) WHERE categorie.cat_id='$cat_id' AND sottocategorie.sottocat_id='$sottocat_id' ORDER BY prodotti.prod_id LIMIT $g1,5";
$r_sel=mysql_query($q_sel) or die ('Errore nella query');
while ($dr=mysql_fetch_assoc($r_sel)){ ?>
</td>
</tr>
<tr>
<td width="8" height="101"></td>
<td width="251" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" background="immagini/prodotti.gif">
<tr>
<td width="15" height="11"></td>
<td width="108"></td>
<td width="14"></td>
<td width="25"></td>
<td width="74"></td>
<td width="15"></td>
</tr>
<tr>
<td height="9"></td>
<td></td>
<td></td>
<td></td>
<td rowspan="5" valign="middle" align="center">[img]public/aq_img/aq_<? print($dr[prod_id]);?>_p.jpg[/img]</td>
<td></td>
</tr>
<tr>
<td height="41"></td>
<td rowspan="3" valign="middle"><font color="#FF6633" face="Arial, Helvetica, sans-serif" size="1"><? print($dr[sottocat_nome]);?></font>
<font color="#000000" face="Arial, Helvetica, sans-serif" size="1"><? print($dr[nome]);?></font></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="14"></td>
<td valign="top">[img]immagini/bottone_prod.jpg[/img]</td>
<td></td>
<td></td>
</tr>
<tr>
<td height="8"></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="2"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="16"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table></td>
<td width="9"></td>
</tr>
<tr>
<td height="10"></td>
<td></td>
<td></td>
</tr>
<? }?>
</table></td>
</tr>
</table>