i am adding elements to my db and the elemtents which have been add will be displayed on a different page. i am using an upload page which creates a thumb nail of an uploaded image and then stores the path for this image in a variable called $thumb_name. the code i have used to enter the image into the db is
include "db.php";
$con = mysql_pconnect("$dbhost","$dbusername","$dbpasswd")
or die ("QUERY ERROR: ".mysql_error());
$db = mysql_select_db("$database_name", $connection)
or die("QUERY ERROR: ".mysql_error());
// Create table in $database_name database
mysql_select_db("$database_name", $connection);
$sql = "CREATE TABLE images
(imageID int NOT NULL AUTO_INCREMENT, Broad1 varchar(50), Broad2 varchar(50), Broad3 varhar(50))";
mysql_query("INSERT INTO images (Broad1) VALUES ('$thumb_name')");
?>
and the code to display the image on the next page looks like this
<?php
include"db.php";
$result = mysql_query("SELECT * FROM images WHERE 'Broad1'='$thumb_name'");
{
echo $row['Broad1'];
echo "<br />";
}
?>