PDA

View Full Version : Unexpected "."



devil_vin
09-30-2007, 02:58 PM
Hey,guys!What went wrong with the script?I having syntax error of unexpected "." in first line of second echo.Thanks...



<?php
$tbl_name = "movie";

$result = mysql_query("SELECT name,director,casting,duration,classification,language, synopsis,banner FROM FROM %s LIMIT 7', $tbl_name") or die("Cannot execute query.");

while ($rows = mysql_fetch_assoc($result)) {
echo '<table width="100%" border="0"><tr><td height="68">
<table width="100%" height="47" border="0">
---------------------------------------------------------------------------------------------------------';
echo . $rows['banner'] .'<strong>'Title: . $rows['name'] .'<br>'
Classification: . $rows['classification'] .'<br>'Duration:
. $rows['duration'] .'<br>' Language: . $rows['language'] .'<br>'
Director: . $rows['director'] .'<br>'Cast: . $rows['cast'] .'<br>'
Synopsis: . $rows['synopsis'] .'<br></strong>';
}
?>

thetestingsite
09-30-2007, 03:11 PM
The first . you don't need in that line. Get rid of the dot right after the echo and it should be fine.
Hope this helps.

devil_vin
09-30-2007, 03:43 PM
Well,what wrong again?The second line having T_CONSTANT_ENSCAPED_STRING expecting ' ' or ';'



echo $rows['banner'] .'<strong>Title:' . $rows['name'] .'<br>'
'Classification:' . $rows['classification'] .'<br>Duration:'
. $rows['duration'] .'<br> Language:' . $rows['language'] .'<br>'
'Director:' . $rows['director'] .'<br>Cast:' . $rows['cast'] .'<br>'
'Synopsis:' . $rows['synopsis'] .'<br></strong>';

thetestingsite
09-30-2007, 04:00 PM
You had some extra quotes in there that didn't need to be. Try the below in its place.



echo $rows['banner'] .'<strong>Title:' . $rows['name'] .'<br>
Classification:' . $rows['classification'] .'<br>Duration:'
. $rows['duration'] .'<br> Language:' . $rows['language'] .'<br>
Director:' . $rows['director'] .'<br>Cast:' . $rows['cast'] .'<br>
Synopsis:' . $rows['synopsis'] .'<br></strong>';


Hope this helps.

devil_vin
09-30-2007, 04:03 PM
Problem resolved.thanks