S
sweettooth_15
Guest
This is a simple test php file that retrieves a pathname saved in a database and then displays the image.
My code:
<?php
//connects to db
$con = mysql_connect ("localhost","root","");
if ($con)
//echo 'success!';
//selects db
$result = mysql_select_db("alumnidb",$con);
$query = "SELECT *
FROM photos";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
echo $row['url']."<br>";
// $row['url'] = 'uploads0707403457\as\black-rose.jpg';
echo "<img src = 'uploads0707403457\as\black-rose.jpg' height = 100 width = 100></img>";
?>
The image doesn't show
the folder uploads is in the same folder as the php file 
My code:
<?php
//connects to db
$con = mysql_connect ("localhost","root","");
if ($con)
//echo 'success!';
//selects db
$result = mysql_select_db("alumnidb",$con);
$query = "SELECT *
FROM photos";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
echo $row['url']."<br>";
// $row['url'] = 'uploads0707403457\as\black-rose.jpg';
echo "<img src = 'uploads0707403457\as\black-rose.jpg' height = 100 width = 100></img>";
?>
The image doesn't show

