i have a db that stores film and film reviews and using php i have created a system where the user can search for a review and then a list of reviews appear, i want to create a button with each review so that when selected the individual review can be analysed this will search the review to see how many positive and negative words it has
this is the code for my review.php
<?php
$searching=$_POST['searching'];
$searchfilm=$_POST['searchfilm'];
//If form is submitted
if ($searching =="yes")
{
echo "<h2>Film Review</h2><p>";
//If field is empty send a message
if ($searchfilm == "")
{
echo "<p>You forgot to enter a search term";
echo
exit;
}
//Connect to database
mysql_connect("nmnm", "jkjk", "mnm") or die(mysql_error());
mysql_select_db("nmnnm") or die(mysql_error());
//Filter search
$searchfilm = strtoupper($searchfilm);
$searchfilm = strip_tags($searchfilm);
$searchfilm = trim ($searchfilm);
//Qyery database
$data = mysql_query("SELECT film.filmname, review.filmreview, review.reviewtitle FROM film, review WHERE film.filmid = review.filmid AND filmname = '$searchfilm'");
//$result = mysql_query($data) or die(mysql_error());
//Display film title searched for
echo "<b>Film Name:</b> " .$searchfilm;
echo "<p>";
//Display results
while($row = mysql_fetch_array($data))
{
// echo $row['filmname'];
// echo "<b>Film Name:</b> " .$searchfilm;
echo "<table border=\"2\" align=\"left\">";
echo "<tr><td>";
echo "<b>Review Title:</b> " .$row['reviewtitle'];
echo "<tr><td>";
echo $row['filmreview'];
echo "<p>";
echo "<form method='post' action='analyse.php'>";
echo "<tr><td><input type='submit' name='analyse' value='Analyse'/></td></tr>";
echo "</form>";
echo "</table>";
}
//If result doesn't exist give an error message
$anymatches = mysql_num_rows($data);
if ($anymatches == 0)
{
echo "Your request could not be processed, please enter a valid search<br><br>";
}
}
?>
i am unsure is i have added the button correctly to the display results section too
any help would be appreciated