First and foremost: I´m a beginner in PHP and Mysql.
I´d like change this to retrieve a picture from a database due to date. I´d like to show the picture a week ahead of the value in it´s date table. If,for example, the value i set to 2010-10-19, then a I would like it to be shown from today and expire 2010-10-20. I guess I have to deal with curdate(), or...?
<?php
$username = "";
$password = "";
$host = "";
$database = "";
@mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error());
@mysql_select_db($database) or die("Can not select the database: ".mysql_error());
$id = $_GET['show_date'];
if(!isset($id) || empty($id)){
die("There is no pic");
}else{
$query = mysql_query("SELECT * FROM nhto_gigpress_shows WHERE show_date ='".$id."'");
$row = mysql_fetch_array($query);
$content = $row['show_pic'];
header('Content-type: image/jpg');
echo $content;
}
?>