1) How can I display this image as thumbnail?
2) How can I make the thumbnail link to the origional image or another page?
3) How can I put this PHP file in any folder and always display the image in the /public_html/images/ folder?
Code: Select all
<?php
// Set the variables for the database access:
$host="localhost";
$username="";
$password="";
$database="Photos";
$table="Table_1";
// Connect to database and go to correct database
mysql_connect ($host, $username, $password) or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ($database) or die ("<b>Database $database does not exist</b>");
$query = "SELECT * from $table";
$result = mysql_query($query) or exit();
$row = mysql_fetch_row($result);
mysql_close();
?>
<img src="images/<?php echo($row[2]); ?>">