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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.