- Home
- Categorie
- Coding e Sistemistica
- Coding
- problema mysql_result
- 
							
							
							
							
							
problema mysql_resultsul sito mi esce qst errore: Warning: mysql_result() expects parameter 1 to be resource, object given in codice da me usato : [PHP]<div> 
 <?
 $query = "SELECT c.CAS_ID, c.TITOLO, i.NOME,c.DES_BREVE,c.DESC_ESTESA,c.OFFERTA_SPECIALE FROMCASEc LEFT JOINIMMAGINIi 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>[/PHP]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 
 
- 
							
							
							
							
							
provato e riprovato ma niente... 
 scusa riusciresti a farmi un esempio?
 grazie mille
 
- 
							
							
							
							
							
a ki dovesse servire ho risolto cosi: [PHP]<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>[/PHP]