Hallo,
schluss...aus...ich kann nicht mehr.
Habe seit Tagen alle möglichen Blätterfunktions-Tips durchprobiert, aber bin zu keinem Erfolg gekommen. Selbst bei Mr. Google habe ich keine großartige Hilfe bekommen.
Weiß nicht wo ich den Schnipsel einbauen soll.
Vielleicht habt ihr ja ne Idee wie ich hier weiterkomme. Es handelt sich um diesen Schnipsel http://www.php-einfach.de/tuts_mysql_blaetterfunktion.php
Und hier ist mein Sorgenkind:
	
Gruß dic4
							
						
					schluss...aus...ich kann nicht mehr.
Habe seit Tagen alle möglichen Blätterfunktions-Tips durchprobiert, aber bin zu keinem Erfolg gekommen. Selbst bei Mr. Google habe ich keine großartige Hilfe bekommen.
Weiß nicht wo ich den Schnipsel einbauen soll.
Vielleicht habt ihr ja ne Idee wie ich hier weiterkomme. Es handelt sich um diesen Schnipsel http://www.php-einfach.de/tuts_mysql_blaetterfunktion.php
Und hier ist mein Sorgenkind:
PHP-Code:
	
	
<?php
session_start();
?>
<?php
@require_once("common/defines.inc.php");
@require_once("common/definesdata.inc.php");
/*
###### Open database connection
*/
if($mysql = mysql_connect(DB_HOST,DB_USER,DB_PASS))
{
  if( ! mysql_select_db(DB_NAME, $mysql))
  {
    mysql_close($mysql);
    $mysql = 0;
  }
}
$mywhere = "WHERE ";
$mywhere .= "1=1 ";
if ($_POST["bundesland"] != "" && $_POST["bundesland"] != "-1" && $_POST["bundesland"] != "1")
{
  $mywhere .= "AND (bundesland = ".$_POST['bundesland']." OR bundesland='1') ";
}
if ($_POST["regbez2"] != "" && $_POST["regbez2"] != 1 && $_POST["bundesland"] != "1")
{
  $mywhere .= "AND (landkreis = ".$_POST['regbez2']." OR landkreis='0') ";
}
if ($_POST["bad"] != "")
{
  $mywhere .= "AND bad = ".$_POST['bad']." ";
}
if ($_POST["nurmitbild"] != "")
{
  $mywhere .= "AND bild1 != '' ";
}
if ($_POST["step"] != "")
{
  $mylimit = " Limit ".(int)$_POST["step"];
}
else
{
  $mylimit = " Limit 50";
}
/*
###### building select query
*/
$myquery = <<<SQL
SELECT
id,
firma,
titelanzeige,
beschreibung,
bad,
preis,
bild1
FROM
    pk_schwimmbad
$mywhere
$mylimit
;
SQL;
//echo $myquery;
//echo "<hr>";
if($mysql)
{
  if($result = mysql_query($myquery,$mysql))
  {
    $myresult = array();
    $i = 0;
    while($objectcheck = mysql_fetch_array($result))
        {
            $myresult[$i]["myid"]                  = $objectcheck["id"];
            $myresult[$i]["firma"]                 = $objectcheck["firma"];
            $myresult[$i]["titelanzeige"]          = $objectcheck["titelanzeige"];
            $myresult[$i]["beschreibung"]          = $objectcheck["beschreibung"];
          $myresult[$i]["bad"]                   = $objectcheck["bad"];
            $myresult[$i]["bild1"]                 = $objectcheck["bild1"];
            $myresult[$i]["preis"]                 = $objectcheck["preis"];
      $i++;
    }
  }
  else
  {
      // datenbankabfrage fehlgeschlagen
      $mymessage = "Leider gab es einen Fehler bei Ihrer Anfrage. Bitte versuchen Sie es erneut.(2)";
            mysql_close($mysql);
  }
  mysql_free_result($result);
  mysql_close($mysql);
}
else
{
      // datenbank weg
      $mymessage = "Leider gab es einen Fehler bei Ihrer Anfrage. Bitte versuchen Sie es erneut.(3)";
            mysql_close($mysql);
}
?>
                  </div>
                    <br></td>
                  <td style="width: 10; vertical-align: top" height="93"><img alt="" src="images/spacer.gif" style="width: 10px; height: 1px;"> </td>
                  <td style="vertical-align: top;" width="505" height="49"><br>
                  <b><font color="#2C2C60" size="2">Suchergebnis Schwimmbad</font><font color="#2C2C60" size="3"><br>
                  </font></b><font face="Arial" style="font-size: 8pt">Suche ergab <?php echo count($myresult); ?> Anzeigen.. </font>
                  <table class="tableframe" cellSpacing="1" width="108%" border="0">
                    <tr>
                      <td width="18%" bgColor="#5B7696"><font color="#FFFFFF">
                      <b>Objekttyp</b></font></td>
                      <td width="55%" bgColor="#5B7696"><font color="#FFFFFF">
                      <b>Preis</b></font></td>
                      <td width="15%" bgColor="#5B7696"><font color="#FFFFFF"><b>Bild</b></font></td>
                    </tr>
<?php
for ($i = 0; $i < count($myresult);$i++)
{
  $myid                = $myresult[$i]["myid"];
  $mytitle             = $myresult[$i]["firma"];
  $myobjekt            = $myresult[$i]["kamin"];
  $myobjekt            = $kamin[$myobjekt];
  $mypreis             = $myresult[$i]["preis"];
  $titelanzeige        = $myresult[$i]["titelanzeige"];
  $beschreibung        = $myresult[$i]["beschreibung"];
  $mypic               = $myresult[$i]["bild1"];
    // für die kleinen bilder 
    if ($mypic != "")
    {
      $mypic = preg_replace("/\_big\_/","_th_",$mypic);
  }
  else
  {
    $mypic = "b.gif";
  }
  $color1 = "4EACB8";
  $color2 = "000080";
  if (($i % 2) == 0)
  {
    $color = $color1;
  }
  else
  {
    $color = $color2;
  }
  $mysid = session_id();
  echo <<<EOF
                    <tr><td width="88%" bgColor="#$color" colspan="3"><a href="schwimmbad_detail.php?myid=$myid&b=1&PHPSESSID=$mysid"><b>
                    <font color="#FFFFFF">$titelanzeige</font></b></a></td></tr>
                    <tr>
                      <td width="18%" bgColor="#F2F0F0"><font color="#000000"> $myobjekt</font></td>
                      <td width="56%" bgColor="#F2F0F0"> <font color="#006121"><b>$mypreis</b></font> EUR</td>
                      <td width="15%" bgColor="#F2F0F0">
                      <a href="schwimmbad_detail.php?myid=$myid&b=1&PHPSESSID=$mysid">
                      <img border="0" src="kbbilder/schwimmbad/$mypic" width="70" height="55" border="0" /></a></td>
                    </tr>
EOF;
}
?>
                 
</table>
</div>
</body>
</html>
          

Kommentar