Jump to content

Display Uploaded Images


lopis

Recommended Posts

I want to display the images that i have uploaded, and they are stored in my database, but when i try to display them, they dont show very well, need help!!

 

  <html>

<title>

Produtos

</title>

<body bgcolor="#99CCCC">

<center><font face = "Agency FB" size="6"> Listar Porto </font> <br><br>

 

 

 

<?php

 

$ligacao=mysql_connect('localhost','root','') or die("Problema na ligação ao MySQL");

mysql_select_db("site");

 

$sql = "select * from productos";

$result = mysql_query($sql) or die ("Nao consegui ligar a db");

while($row=mysql_fetch_assoc($result))

{

                  echo "<div class=\"Image\">";

                  echo "<p>";

 

  // Note that we are building our src string using the filename from the database

    echo "<img src=\"Image/" . $row['imagelocation'] . "\" alt=\"\" height='100' width='100'  />";

      echo $row['nome'] . " " . $row['marca'] . "";

      echo "</p>";

      echo "</div>";

}

 

 

mysql_close();

?>

 

</body>

</html>

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/230546-display-uploaded-images/
Share on other sites

Sorry, I've just realised you are trying to find an image folder inside an image folder.

 

Your database shows the full directory, therefore you needn't include the image folder within your html code.

Unless you have an image folder within an image folder.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.