Hallo Leute.
Hallo Habe Ein kleines problem mit der phpmysql auf meiner seite kann mir da einer helfen bitte
SQL
$slides_query = mysql_query("SELECT *
FROM offers
LIMIT 3");
$gs_offer = array();
$vs_offer = array();
$na_offer = array();
$count = 0;
while ($row = mysql_fetch_array($slides_query)) {
if ($count) {
$vs_offer["titel"] = utf8_encode($row["titel"]);
$vs_offer["price"] = str_replace(".", ",", $row["price"]);
$vs_offer["features"] = explode("\n", utf8_encode($row["features"]));
$vs_offer["link"] = $row["link"];
} else {
$gs_offer["titel"] = utf8_encode($row["titel"]);
$gs_offer["price"] = str_replace(".", ",", $row["price"]);
$gs_offer["features"] = explode("\n", utf8_encode($row["features"]));
$gs_offer["link"] = $row["link"];
$na_offer["titel"] = utf8_encode($row["titel"]);
$na_offer["price"] = str_replace(".", ",", $row["price"]);
$na_offer["features"] = explode("\n", utf8_encode($row["features"]));
$na_offer["link"] = $row["link"];
}
$count++;
}
?>
Alles anzeigen
SQL
<div class="box1">
<div class="offer_title">
<?php echo $gs_offer["titel"]; ?>
</div><!-- end offer title -->
<div class="offer_price">
ab <?php echo $gs_offer["price"]; ?> <small>/mtl. </small>
</div><!-- end price -->
<div style="width:260px;">
<ul class="offer_list" style="margin-top:20px;">
<?php
foreach ($gs_offer["features"] as $feature)
echo '<li><span style="color:#FF6600; font-size:14px;">'.utf8_decode($feature).'</span></li>';
?>
</ul><!-- end offer list -->
</div>
<div style="text-align:center; margin-top:10px;">
<a href="<?php echo $gs_offer["link"]; ?>" title="Jetzt Informieren">
<img src="themes/dynamicwebmedia/images/images/moreinfo.jpg" alt="Bestellen" />
</a>
</div><!-- end bestellen -->
</div><!--end box 1 -->
<div class="box2">
<div class="offer_title">
<?php echo $vs_offer["titel"]; ?>
</div><!-- end offer title -->
<div class="offer_price">
ab <?php echo $vs_offer["price"]; ?> <small>/mtl. </small>
</div><!--end price -->
<div style="width:260px;">
<ul class="offer_list" style="margin-top:20px;">
<?php
foreach ($vs_offer["features"] as $feature)
echo '<li><span style="color:#FF6600; font-size:14px;">'.utf8_decode($feature).'</span></li>';
?>
</ul><!-- end offer list -->
</div>
<div style="text-align:center; margin-top:10px;">
<a href="<?php echo $vs_offer["link"]; ?>" title="Jetzt Informieren">
<img src="themes/dynamicwebmedia/images/images/moreinfo.jpg" alt="Bestellen" />
</a>
</div><!-- end bestellen -->
</div><!--end box 2-->
<div class="box3">
<div class="offer_title">
<?php echo $na_offer["titel"]; ?>
</div><!-- end offer title -->
<div class="offer_price">
ab <?php echo $na_offer["price"]; ?> <small>/mtl. </small>
</div><!--end price -->
<div style="width:260px;">
<ul class="offer_list" style="margin-top:20px;">
<?php
foreach ($na_offer["features"] as $feature)
echo '<li><span style="color:#FF6600; font-size:14px;">'.utf8_decode($feature).'</span></li>';
?>
</ul><!-- end offer list -->
</div>
<div style="text-align:center; margin-top:10px;">
<a href="<?php echo $na_offer["link"]; ?>" title="Jetzt Informieren">
<img src="themes/dynamicwebmedia/images/images/moreinfo.jpg" alt="Bestellen" />
</a>
</div><!-- end bestellen -->
</div><!--end box 3-->
Alles anzeigen
2 boxen werden gleich angezeigt der fehler steckt hier drin kann mir da einer helfen
SQL
$slides_query = mysql_query("SELECT *
FROM offers
LIMIT 3");
$gs_offer = array();
$vs_offer = array();
$na_offer = array();
$count = 0;
while ($row = mysql_fetch_array($slides_query)) {
if ($count) {
$vs_offer["titel"] = utf8_encode($row["titel"]);
$vs_offer["price"] = str_replace(".", ",", $row["price"]);
$vs_offer["features"] = explode("\n", utf8_encode($row["features"]));
$vs_offer["link"] = $row["link"];
} else {
$gs_offer["titel"] = utf8_encode($row["titel"]);
$gs_offer["price"] = str_replace(".", ",", $row["price"]);
$gs_offer["features"] = explode("\n", utf8_encode($row["features"]));
$gs_offer["link"] = $row["link"];
$na_offer["titel"] = utf8_encode($row["titel"]);
$na_offer["price"] = str_replace(".", ",", $row["price"]);
$na_offer["features"] = explode("\n", utf8_encode($row["features"]));
$na_offer["link"] = $row["link"];
}
$count++;
}
?>
Alles anzeigen
bitte um hilfe