PHP output results on to one page

Posted by linda on Stack Overflow See other posts from Stack Overflow or by linda
Published on 2012-04-04T11:48:11Z Indexed on 2012/04/08 23:30 UTC
Read the original article Hit count: 227

Filed under:
|
|

i have a system where a user searches for a film and reviews appear on a page with a button next to each review. The button can be selected to look at the individual review but i basically want a button that when selected it will look at all reviews on one page, the code i am using for the individual review is this

<?php

ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);


$searchfilm=$_POST['searchfilm'];


//Connect to database



//Filter search
$searchfilm = strtoupper($searchfilm);
$searchfilm = strip_tags($searchfilm);
$searchfilm = trim ($searchfilm);

$query = mysql_fetch_assoc(mysql_query("SELECT filmreview FROM review WHERE id = '$id'"));
$data = mysql_query("SELECT film.filmname, review.filmreview, review.reviewtitle, review.id FROM film, review WHERE film.filmid = review.filmid AND filmname = '$searchfilm'");  

while($row = mysql_fetch_assoc($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='analyse1.php'>";
    echo "<input type='hidden' name='reviewid' value='".$row['id']."'>";
    echo "<input type='submit' name='submit' value='Analyse'>";
    echo "</form>";     
    echo "</table>";

}

?>

© Stack Overflow or respective owner

Related posts about php

Related posts about button