Pieter Lategan Posted July 3, 2011 Share Posted July 3, 2011 Hi I got this error Parse error: syntax error, unexpected $end in C:\xampp\htdocs\chapter2\table1.php on line 60 can someone maybe help me with it. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <?php //connect to MySQL $connect = mysql_connect ("localhost", "root","") or die ("Hey loser, chech your server connection."); // make sure we're using the right database mysql_select_db ("moviesite") or die (mysql_error()); $query = "select movie_name, movie_director, movie_leadactor " . "from movie"; $result = mysql_query($query, $link) or die (mysql_error()); $num_movies = mysql_num_rows($result); $movie_header=<<<EOD <h2><center> Movie Review Database</center></h2> <table width="70%" border="1"cellpadding="2" cellspacing="2" align = "center"> <tr> <th> Movie Title</th> <th> Year of Release</th> <th> Movie Director</th> <th>Movie Lead Actor</th> <th> Movie Type</th> </tr> </table> EOD; $movie_details= ''; while ($row = mysql_fetch_array($result)) { $movie_name = $row ['movie_name']; $movie_director =$row['movie_director']; $movie_leadactor = $row['movie_leadactor']; $movie_details .=<<<EOD <tr> <td> </td> </tr> <tr> <td>Total :$num_movies Movies</td> </tr> EOD; echo $movie_header; ?> </body> </html> This is line 60 Quote Link to comment https://forums.phpfreaks.com/topic/241014-syntax-error-unexpected-end-in/ Share on other sites More sharing options...
mikesta707 Posted July 3, 2011 Share Posted July 3, 2011 You are missing the closing bracket (the } character) for your while loop Quote Link to comment https://forums.phpfreaks.com/topic/241014-syntax-error-unexpected-end-in/#findComment-1237946 Share on other sites More sharing options...
Pieter Lategan Posted July 3, 2011 Author Share Posted July 3, 2011 Thank you Quote Link to comment https://forums.phpfreaks.com/topic/241014-syntax-error-unexpected-end-in/#findComment-1237947 Share on other sites More sharing options...
mikesta707 Posted July 3, 2011 Share Posted July 3, 2011 No problem. I''m going to mark your topic solved. Edit: you got to it before me. good. Quote Link to comment https://forums.phpfreaks.com/topic/241014-syntax-error-unexpected-end-in/#findComment-1237948 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.