Hi,
Folgender Code zeigt bei mir eine Tabelle von Produkten an mit einem entsprechendem Bild in der ersten Spalte:
Jetzt möchte ich es gerne noch so machen, dass wenn der User auf das Bild klickt ein entsprechendes Popup-Fenster geöffnet wird und das Bild in Originalgröße angezeigt wird. Ich habe jedes Bild in der DB auch immer in Originalgröße gespeichert.
Bin für jede Hilfe dankbar...
matti
Folgender Code zeigt bei mir eine Tabelle von Produkten an mit einem entsprechendem Bild in der ersten Spalte:
Code:
<?php $query = "Select ProductId, SmallImage, Name, UnitPrice FROM product ORDER BY Name ASC"; // Connect to the MySQL server if (!($connection = @ mysql_connect($hostname, $username, $password))) die("Cannot connect"); if (!(mysql_select_db($databaseName, $connection))) showerror(); // Run the query on the connection if (!($result = @ mysql_query ($query, $connection))) showerror(); // Start a table, with column headers print "\n<table border=1>\n<tr>\n" . print "<tr>"; print "<th>Image</th>"; print "<th>Name</th>"; print "<th>Price</th>"; print "</tr>"; // Until there are no rows in the result set, fetch a row into // the $row array and ... while ($row = @mysql_fetch_array ($result)) { $productId = $row["ProductId"]; $image = $row["SmallImage"]; $name = $row["Name"]; $price = $row["UnitPrice"]; print "<tr>"; print "<td> <img src=\"picture.php?id=$productId\" </td>"; print "<td> <a href=\"../Products/details.php?id=$productId\"> $name </a></td>"; print "<td align=\"right\"> $price </td>"; print "</tr>"; } ?>
Bin für jede Hilfe dankbar...
matti
Kommentar