I am writing PHP code for a dynamic web page. The SQL query code below looks correct, but whenever the page runs, I keep getting the message within the die parameter.
$recipeid = $_GET['id'];
$query = "select title from recipes where recipeid = $recipeid";
$result = mysql_query($query) or die('Could not retrieve file');
Why does the query keep failing?