Autor Zpráva
Peter45
Profil
Zdravim,mam takyto problem.Dole uvedeny kod je sice ok ale potreboval by som dorobit jeden riadok naviac pre zobrazenie trebars nazov
<? echo $zaznam[nazov]; ?>
co mi vsak uz nefunguje,v tabulke je to stredny riadok no nazov mi nezobrazuje...neviem snad sa chapeme


<? 

if ($shopid)  $katsql="kategoria='$shopid' AND"; 

$srchQ = "SELECT * FROM tovar  WHERE $katsql  nazov<>'' AND checkbox<>'' ORDER BY poradie2 ASC ";

if ($shopid) $srchQ = "SELECT * FROM tovar WHERE $katsql  nazov<>'' AND checkbox<>'0' ORDER BY poradie ASC ";

//if (!$shopid && !$search) $srchQ.="ORDER BY rand() "; 
//else $srchQ.= " ORDER BY poradie ASC ";

if ($search) $srchQ = "SELECT * FROM tovar WHERE nazov LIKE '%$search%' OR popis LIKE '%$search%' AND nazov<>'' ORDER BY cena ASC ";

$srch = MySQL_Query($srchQ);
$totalrows = MySQL_Num_Rows($srch);

//if (!$nolimit) $srchQ.=" LIMIT 0,15 ";

//echo $srchQ;

$srch = MySQL_Query($srchQ);
$rows = MySQL_Num_Rows($srch);

if ($rows==0) error("Žiadny záznam nebol nájdený.", "");
?>

<? function show_mini()
{
global $srch,$t,$rows,$e,$cena1,$cena2,$cena3,$cena4,$cena5,$cena6,$kat1,$kat2,$kat3,$euro;
$t++; if ($t<=$rows):
$zaznam = MySQL_Fetch_Array($srch); 
//if (strlen($zaznam[obrazok])<8 || $zaznam[obrazok]=="images/logosmall.gif") $zaznam[obrazok]="images/logosmall2.gif";


$ahref="a href=\"?id=$zaznam[id]\"";
echo "<div class=\"noa\"><$ahref><img src=\"myimages/m-$zaznam[foto]\" border=\"0\" class=\"noa\" width=\"110\"  alt=\"$zaznam[nazov]\" title=\"$zaznam[nazov]\" /><br />
$zaznam[nazov]</a></div>"; 


$e++;
if ($e==1) $cena1="<div class=\"cena\">".number_format($zaznam[cena]*1.19, 2, ","," ")." &euro; <br>(".number_format( $zaznam[cena]*1.19*$euro , 2, ',', ' ')." Sk)</div>"; 
elseif ($e==2) $cena2="<div class=\"cena\">".number_format($zaznam[cena]*1.19, 2, ","," ")." &euro; <br>(".number_format( $zaznam[cena]*1.19*$euro , 2, ',', ' ')." Sk)</div>"; 
elseif ($e==3) $cena3="<div class=\"cena\">".number_format($zaznam[cena]*1.19, 2, ","," ")." &euro; <br>(".number_format( $zaznam[cena]*1.19*$euro , 2, ',', ' ')." Sk)</div>"; 
elseif ($e==4) $cena4="<div class=\"cena\">".number_format($zaznam[cena]*1.19, 2, ","," ")." &euro; <br>(".number_format( $zaznam[cena]*1.19*$euro , 2, ',', ' ')." Sk)</div>"; 
elseif ($e==5) $cena5="<div class=\"cena\">".number_format($zaznam[cena]*1.19, 2, ","," ")." &euro; <br>(".number_format( $zaznam[cena]*1.19*$euro , 2, ',', ' ')." Sk)</div>"; 
elseif ($e==6) $cena6="<div class=\"cena\">".number_format($zaznam[cena]*1.19, 2, ","," ")." &euro; <br>(".number_format( $zaznam[cena]*1.19*$euro , 2, ',', ' ')." Sk)</div>"; 

if ($e==6) $e=0;
endif;
}

?>

<table style="margin-top: 5px;" width="200"  border="0" cellpadding="1" cellspacing="1" bgcolor="#eeeeee" >
<?	for ($i=0;$i<$rows;$i=$i+6): 
//echo "i=$i rows=$rows ";

if ($i!=$rows && $i+1<=$rows):
?>

  <tr >
    <td style="width:10px;" valign="top" bgcolor="#FFFFFF" class="tdpic2big"><div style="margin-top:5px;"><? show_mini(); ?></div></td>
    <td style="width:10px;" valign="top" bgcolor="#FFFFFF" class="tdpic2big"><div style="margin-top:5px;"><? show_mini(); ?></div></td>
    <td style="width:10px;" valign="top" bgcolor="#FFFFFF" class="tdpic2big"><div style="margin-top:5px;"><? show_mini(); ?></div></td>
    <td style="width:10px;" valign="top" bgcolor="#FFFFFF" class="tdpic2big"><div style="margin-top:5px;"><? show_mini(); ?></div></td>
    <td style="width:10px;" valign="top" bgcolor="#FFFFFF" class="tdpic2big"><div style="margin-top:5px;"><? show_mini(); ?></div></td>
    <td style="width:10px;" valign="top" bgcolor="#FFFFFF" class="tdpic2big"><div style="margin-top:5px;"><? show_mini(); ?></div></td>
    
    
  </tr>
    <tr >
    <td  valign="top" bgcolor="#FFFFFF" class="tdpic3big"><? echo $zaznam[nazov]; ?></td>
    <td  valign="top" bgcolor="#FFFFFF" class="tdpic3big"><? echo $zaznam[nazov]; ?></td>
    <td  valign="top" bgcolor="#FFFFFF" class="tdpic3big"><? echo $zaznam[nazov]; ?></td>
    <td  valign="top" bgcolor="#FFFFFF" class="tdpic3big"><? echo $zaznam[nazov]; ?></td>
    <td  valign="top" bgcolor="#FFFFFF" class="tdpic3big"><? echo $zaznam[nazov]; ?></td>
    <td  valign="top" bgcolor="#FFFFFF" class="tdpic3big"><? echo $zaznam[nazov]; ?></td>
  </tr>
  <tr >
    <td  valign="top" bgcolor="#FFFFFF" class="tdpic3big"><? $tt++; if ($tt<=$rows) echo $cena1 ?></td>
    <td  valign="top" bgcolor="#FFFFFF" class="tdpic3big"><? $tt++; if ($tt<=$rows) echo $cena2 ?></td>
    <td  valign="top" bgcolor="#FFFFFF" class="tdpic3big"><? $tt++; if ($tt<=$rows) echo $cena3 ?></td>
    <td  valign="top" bgcolor="#FFFFFF" class="tdpic3big"><? $tt++; if ($tt<=$rows) echo $cena4 ?></td>
    <td  valign="top" bgcolor="#FFFFFF" class="tdpic3big"><? $tt++; if ($tt<=$rows) echo $cena5 ?></td>
    <td  valign="top" bgcolor="#FFFFFF" class="tdpic3big"><? $tt++; if ($tt<=$rows) echo $cena6 ?></td>
  </tr>
<? endif ?>
<? endfor; ?>
</table>


Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: