<?PHP
$db_name = "table";
$link = mysql_connect("localhost", "username", "password") or die("Could not connect to server!");
$db = mysql_select_db($db_name, $link) or die("Could not select database!");
$query = "Select * from photos where ID = '" . $_Request['ID'] . "'"; //<----Missing " here.
echo ("caption");
?>