-
sul sito mi esce qst errore: Warning: mysql_result() expects parameter 1 to be resource, object given in
codice da me usato :
<div> <? $query = "SELECT c.CAS_ID, c.TITOLO, i.NOME,c.DES_BREVE,c.DESC_ESTESA,c.OFFERTA_SPECIALE FROM `CASE` c LEFT JOIN `IMMAGINI` i ON c.CAS_ID = i.CAS_ID where VISIBLE = 1 and DEF = 1 and HOME = 1 order by c.CAS_ID DESC"; $result = mysqli_query($mysqli , $query); $num = mysqli_num_rows($result); $i=0; $count = 1; while ($i < $num && $i <5) { $id_case[] = mysqli_result($result,$i,"CAS_ID"); ?> <a style="border:1px solid #e2001a; margin-bottom:10px; display:block;" class="box_case" href="javascript:;" onClick="showCasa('bigbox_<? echo mysql_result($result,$i,"CAS_ID");?>'); updateStatCasa(<? echo mysql_result($result,$i,"CAS_ID");?>)"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td style="padding:15px 0 15px 15px; cursor:pointer;" width="120" align="center" valign="top"><img src="<?php echo mysql_result($result,$i,"NOME"); ?>" height="90" /></td> <td style="padding:15px 15px 15px 10px; cursor:pointer;" valign="top"> <span style="font-weight:bold; font-size:12px; color:#13007d;"><?php echo mysql_result($result,$i,"TITOLO"); ?></span> <br /> <?php echo mysql_result($result,$i,"DES_BREVE"); ?> </td> </tr> </table> </a> <? $i++;$count++; } ?> </div>nella riga 5 e 6 ho aggiunto la ' i ' alla funzione mysql e funziona, ma nella mysql_result nn va..
sapete darmi una mano?
grazie a tutti!! -
Non funziona perché anche alla fine dovresti usare questa
-
-
a ki dovesse servire ho risolto cosi:
<div> <? $query = "SELECT c.CAS_ID, c.TITOLO, i.NOME,c.DES_BREVE,c.DESC_ESTESA,c.OFFERTA_SPECIALE FROM `CASE` c LEFT JOIN `IMMAGINI` i ON c.CAS_ID = i.CAS_ID where VISIBLE = 1 and DEF = 1 and HOME = 1 order by c.CAS_ID DESC"; $result = mysqli_query($mysqli , $query); $num = mysqli_num_rows($result); $i=0; $count = 1; while ($row = mysqli_fetch_assoc($result)) {?> <a style="border:1px solid #e2001a; margin-bottom:10px; display:block;" class="box_case" href="javascript:;" onClick="showCasa('bigbox_<? echo $row["CAS_ID"];?>'); updateStatCasa(<? echo $row["CAS_ID"];?>)"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td style="padding:15px 0 15px 15px; cursorointer;" width="120" align="center" valign="top"><img src="<?php echo $row["NOME"]; ?>" height="90" /></td> <td style="padding:15px 15px 15px 10px; cursorointer;" valign="top"> <span style="font-weight:bold; font-size:12px; color:#13007d;"><?php echo $row["TITOLO"]; ?></span> <br /> <?php echo $row["DES_BREVE"]; ?> </td> </tr> </table> </a> <? $i++;$count++; } ?> </div>
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi