Jump to content

Image link from db


Sorrow

Recommended Posts

Hi there, I am trying to load the image link from the database to have an image displayed but the image is not loading at all.

<?php

include 'opendb.php';
$currIndex = $_GET['index'];
$query  = "SELECT * FROM reviews where m_index = $currIndex";
$result = mysql_query($query);


while($row = mysql_fetch_array($result, MYSQL_ASSOC))


{
$Pic = "{$row['m_Link']}";
    echo "{$row['m_Title']} <p>".
"{$row['m_Review']} <br> 
<img src='$Pic'>";
}
mysql_close($con);


?>
</body>
</html>

Link to comment
Share on other sites

Shouldn't it be:

<?php

include 'opendb.php';
$currIndex = $_GET['index'];
$query  = "SELECT * FROM reviews where m_index = $currIndex";
$result = mysql_query($query);


while($row = mysql_fetch_array($result, MYSQL_ASSOC))


{
$Pic = "{$row['m_Link']}";
    echo "{$row['m_Title']} <p>".
"{$row['m_Review']} <br> 
<img src='{$row['m_Link']}'>";
}
mysql_close($con);


?>
</body>
</html>

?

Link to comment
Share on other sites

Try this:

<?php

 

include 'opendb.php';

$currIndex = $_GET['index'];

$query  = "SELECT * FROM reviews where m_index = $currIndex";

$result = mysql_query($query);

 

 

while($row = mysql_fetch_array($result, MYSQL_ASSOC))

 

 

{

    echo $row['m_Title'] . "<p>". $row['m_Review'] . "<br><img src='" . $row['m_Link'] . "'>";

}

mysql_close($con);

 

 

?>

</body>

Link to comment
Share on other sites

here it is

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Web Of The Living Dead</title>
</head>

<body bgcolor="#000000" text="#FF0000" link="#FF0000" vlink="#FF0000">

28 days later <p>Even though it's only a single disc, the 28 Days Later DVD includes a lot of very interesting features, including the alternate ending that was shown after the end of the film a couple months into its theatrical run. It's much bleaker, as director Danny Boyle and writer Alex Garland say in their optional commentary. Another alternate ending is almost the same as the theatrical ending but slightly less happy. Most interesting is the "radical" alternate ending that takes an entirely different path midway through the film. It wasn't filmed, however, so Boyle and Garland narrate the action over storyboards, and it's a surprisingly engrossing 11 minutes. Boyle and Garland also did a commentary track for the film, and they talk about how they were able to get the shots of deserted London and why they used the ending they did. There are also six very watchable deleted scenes, and Boyle and Garland's comments range from "great sequence" to "a disgrace." Slightly less relevant is a 24-minute documentary that spends its first 10 minutes on the real-life threat of infectious diseases before recapping the film and discussing such elements as the use of digital video and the boot camp the actors had to attend. If you need any further proof that the DVD was a labor of love, even the stills galleries have commentaries. --David Horiuchi
<br> 
<img src='http://rcm-ca.amazon.ca/e/cm?t=weofthlide-20&o=15&p=8&l=as1&asins=B000QTD05C&fc1=FD0202&IS2=1&lt1=_top&lc1=0000FF&bc1=FFFFFF&bg1=000000&f=ifr'></body>
</html>

Link to comment
Share on other sites


<?php

include 'opendb.php';
$currIndex = mysql_real_escape_string($_GET['index']);
$query  = "SELECT * FROM reviews where m_index = '$currIndex'";
$result = mysql_query($query)or die(mysql_error());


while($row = mysql_fetch_array($result, "MYSQL_ASSOC")){

$Pic = $row['m_Link'];
$Title = $row['m_Title'];
$Review = $row['m_Review'];

    echo $Title . "<p>" . $Review . " <br /><img src=\"" . $Pic . "\" /></p>";

}
mysql_close($con);


?>

</body>
</html>

 

Does that work?

 

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.