Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Dream in code tutorial - List of Images</title>
- </head>
- <body>
- <div>
- <?php
- // Grab the data from our upload2 table
- $sql = "select * from upload2";
- $result = mysql_query($sql) or die ("Could not access DB: " . mysql_error());
- echo "<table border=1>";
- while ($row = mysql_fetch_assoc($result))
- {
- echo "<div class=\"picture\">";
- echo "<p>";
- echo "<tr><td width=200>";
- // Note that we are building our src string using the filename from the database
- echo $row['name'] . " <br />";
- echo "<img src=\"images/". $row['name'] . "\" alt=\"\" /> <br /></td></tr>";
- echo "</p>";
- echo "</div>";
- }
- echo"</table>";
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment