cr7489 15 Light Poster

thanks, think i have managed to get it to work but when i search for a film in my DB i have to enter the full word ie not 'inc' for inception so how can i make it so that it would bring up inception

cr7489 15 Light Poster

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))