Hi @ all.
I've got a PhP script which connects to a mySQL DB and shows a few entrys. But the problem is, php shows entry No.1 and repeats entry No2 so many times the database has entrys in the field (mods_schnitt).
I was pleasure to receive help......
(sorry for bad english .... --> only a german 😃 )
here's the code ...
<?php
include("connect.php");
$query = "SELECT
modellstamm.mods_artbez,
modellstamm.mods_id,
modellstamm.bgross,
modellstamm.bklein
FROM
modellstamm
WHERE
modellstamm.mods_schnitt='2322'";
$result = mysql_query($query,$db);
if( !$result )
{
die("Falscher Datensatz !!!");
}
$num_results = mysql_num_rows($result);
echo "<table>\n";
for($i=0;$i<$num_results;$i++)
{
$mods_artbez = mysql_result($result,$row,"mods_artbez");
$mods_id = mysql_result($result,$row,"mods_id");
// Kommentiert, weil Datenbank noch keinen Eintrag hatte $bgross = mysql_result($result,$row,"bgross");
// Kommentiert, weil Datenbank noch keinen Eintrag hatte $bklein = mysql_result($result,$row,"bklein");
$bgross = "1030_2.jpg";
$bklein = "1030_1.jpg";
$row = mysql_fetch_array($result);
if(($i%4)==0)
echo "<tr>\n";
echo "<td>";
?>
<a href="show.php?mods_id=<?php echo $mods_id; ?>"><img src="<?php echo $bklein; ?>" border=0 alt="<?php echo $mods_artbez; ?>"></a><br>
<?php
echo $mods_artbez;
echo "<br>";
echo $mods_id;
echo "</td>\n";
if(($i%4)==3)
echo "</tr>\n";
}
echo "</table>\n";
?>
mfg - SebHoff