Hello again,
My second noobie question in 30 mins.
I have this code…
<?php
//CONNECT TO THE DATABASE
$con = mysql_connect("xxxxx","xxxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("products", $con);
//GET DATA FROM DATABASE
$result = mysql_query("SELECT * FROM mainitems");
// HEADER
require("header.php");
require("home.php");
while($row = mysql_fetch_array($result))
{
echo $row['code'] . "<br />";
echo $row['title'] . "<br />";
echo $row['proddesc'] . "<br />";
echo $row['img'] . "<br />";
}
mysql_close($con);
?>
In the database in the field called “img” I store an image name such as image.jpg I want this image to display in the browser when I run this script. Can anyone tell me how to do this please?
The output I get at the minute looks like this…
0
test title one
test desc one
123.jpg
1
test title one
test desc one
logo.jpg
2
test title 2
test desc 2
3
test title 3
new desc
5
zxc
zxc
zxc
4
Niall item
Nlalls best item
niall.jpg