Hi i have 2 tables:
film - filmid, filmname
review - id, reviewtitle, filmreview, filmid
i basically want to search for a film name thats in the film table then retrieve the review from the review table that matches the film, the match is found using the filmid as the id for the film name
so far i have something like this but it only returns the film id and filmname
//$searching=$_POST;
//$searchfilm=$_POST;
//This is only displayed if they have submitted the form
// if ($searching =="yes")
// {
// echo "<h2>Film Review</h2><p>";
//If they did not enter a search term we give them an error
// if ($searchfilm == "")
// {
// echo "<p>You forgot to enter a search term";
// echo
// exit;
// }
// Otherwise we connect to our Database
// mysql_connect("", "", "") or die(mysql_error());
// mysql_select_db("") or die(mysql_error());
// We preform a bit of filtering
// $searchfilm = strtoupper($searchfilm);
// $searchfilm = strip_tags($searchfilm);
// $searchfilm = trim ($searchfilm);
//Now we search for our search term, in the field the user specified
// $data = mysql_query("SELECT filmid, filmname FROM film WHERE filmname LIKE '$searchfilm'");
//$result = mysql_query($data) or die(mysql_error());
//And we display the results
// while($row = mysql_fetch_array($data))
// {
// echo $row;
// echo "<br>";
// echo $row;
// echo "<br>";
// echo $row;
//echo "<br>";
//}
//This counts the number or results - and if there wasn't any it gives them a little message explaining that
//$anymatches = mysql_num_rows($data);
//if ($anymatches == 0)
//{
//echo "Sorry, but we can not find an entry to match your query<br><br>";
//}
//And we remind them what they searched for
//echo "<b>Searched For:</b> " .$searchfilm;
//}
any help would be appreciated thanks