hey guys i m trying to retrieve data frm Db.. Its a very simple query what cant understand whats going wrong with the code. It shows "[I]Parse error: parse error in C:\wamp\www\php\table.php on line 35[/I]"

here is the code:

<?php
// creating table
include "var1.php";
mysql_select_db('wiley');
$qry="SELECT movie_name,
            movie_leadactor,
            movie_director
       FROM movie";
$result= mysql_query($qry)or
die("can't process". mysql_error());
$num=mysql_num_rows($result);
$movie_header=<<<chk
<h2><center>Movie Reviews</center></h2>
<table align="center" border='0' cellpadding='2' cellspacing='2' width="60%">
<tr>
<th>Movie Title</th>
<th>Movie Actor</th>
<th>Movie Director</th>
</tr>
chk;
while($rows= mysql_fetch_array($result)){
    $movie_name=$rows['movie_name'];
    $movie_leadactor=$rows['movie_leadactor'];
    $movie_director=$rows['movie_director'];

    $movie_details .=<<<EOD
        <tr>
        <td>$movie_name</td>
        <td>$movie_leadactor</td>
        <td>$movie_director</td>
        </tr>
    EOD;
}

?>

Recommended Answers

All 3 Replies

Hey.

The EOD; on line 32 is indented, so the string it is supposed to close never ends. You need to remove the white-spaces before it.

<?php
// This is NOT VALID. Causes a parse error.
echo <<<HERE
This won't print, because the following delimiter
is indented.
    HERE;
?>


<?php
// It should be
echo <<<HERE
This will print, because the following delimiter
is the first thing in the line.
HERE;
?>

P.S.
Use code-tags! I almost didn't spot the problem because you left them out.

EDIT:error spotted above:)

ah!!!
thanx man!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.