0

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;
}

?>

Edited by Reverend Jim: Fixed formatting

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by nits4u
0

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.

Edited by mike_2000_17: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.