Hi there,
Im trying to work out how to display a stored image link from a mysql database in a php webpage, and im a bit stuck. I currently have the code below, but im not sure where to define the path where the images are stored, etc. If anybody could help, that would be great!
<?php
//PHP program connects to the xry database and displays the report results within the browser
$username = "root";
$password = "password";
$hostname = "localhost";
//connection to the MySQL database
$dbhandle = mysql_connect($hostname, $username, $password)
or die("Cannot connect to the database");
//Use xry_test database
$selected = mysql_select_db("xry_test",$dbhandle)
or die("Could not find database");
//Implement the SQL and select the fields from the Table 'summary'
$result = mysql_query("SELECT * FROM pictures");
//Display the data from the table in the database
while ($row = mysql_fetch_array($result)) {
echo "<img src=' ".$take['name']." '>";
//display the results
}
//Terminate the connection
mysql_close($dbhandle);
?>
Cheers,
Joe