#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    56
    Rep Power
    2

    Parse error:syntax error, unexpected '/'


    Hi,

    I am saving images into a folder and storing their names in the MySQL database. I need to fetch and display in a php webpage, but I am receiving an error:

    Parse error: syntax error, unexpected '/' in C:\Program Files\Abyss Web Server\htdocs\My MOVIES\showreport1.php on line 122
    The following is part of the code I am trying to use:

    Code:
    $counter=0; while($row=mysql_fetch_array($result)) { 	$m_id=$row['m_id']; 	$mtitle=$row['mtitle']; 	$myear=$row['myear']; 	$mcountry=$row['mcountry']; 	$mgenres=$row['mgenres']; 	$filename=$row['mfilename'];	 	
    } 	 	
    if($counter>=0) 
    { 	
    echo "<td valign=top>\n 	
    <table width=340 border=1 align=left class=allborder> \n 	 	
    <tr> \n 		
    <td rowspan=4 colspan=3 class=topBorder> <? echo '<img src="./images/'.$row['mfilename'].'" width="90" height="120" alt="" />';  ?>\n 	</tr>\n 	<tr> \n 		
    <td width=120> Title:  <td>$mtitle\n 	
    </tr>\n 		
    <tr> \n 		<td> Year:  <td> $myear\n 	</tr>\n 		<tr> \n 		<td> Country:  <td> $mcountry\n 	</tr>\n 	</tr>\n 		<tr> \n 		<td colspan=6 class=topBorder> <a href=viewdetail.php?m_id=$m_id>View Detail Info</a>\n 	</tr>\n 	</table>\n</td>\n
    I will appreciate your help.

    Joseph
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    18
    Rep Power
    0
    You tried to echo when your already in an echo. I've cleaned it up a bit for you, this might work better:

    PHP Code:
    echo  '
    <td valign=top>      
    <table width=340 border=1 align=left class=allborder>
    <tr><td rowspan=4 colspan=3 class=topBorder><img src="./images/'
    .$row['mfilename'].'" width="90" height="120" alt="" />          </td> 
    <tr><td width=120> Title:  <td>'
    .$mtitle.'      </tr>
    <tr><td> Year:  <td> '
    .$myear.'</tr> '
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    Sydney Australia
    Posts
    183
    Rep Power
    84
    Your html tag attribute values should be quoted.
    Your array element needs to have { and } around it to tell php where the variable starts and ends.

    PHP Code:
    $counter=0;
     while(
    $row=mysql_fetch_array($result)) {
         
    $m_id=$row['m_id'];
         
    $mtitle=$row['mtitle'];
         
    $myear=$row['myear'];
         
    $mcountry=$row['mcountry'];
         
    $mgenres=$row['mgenres'];
         
    $filename=$row['mfilename'];         
    }          
    if(
    $counter>=0
    {     
        echo 
    "<td valign=\"top\">     
        <table width=\"340\" border=\"1\" align=\"left\" class=\"allborder\">          
        <tr>         
        <td rowspan=\"4\" colspan=\"3\" class=\"topBorder\"> <img src=\"./images/
    {$row['mfilename']}\" width=\"90\" height=\"120\" alt=\"\" />
         </tr>
         <tr>         
        <td width=\"120\"> Title:  <td>
    $mtitle     
        </tr>         
        <tr>
        <td> Year:    <td> 
    $myear
         </tr>
        <tr>
        <td> Country:    <td> 
    $mcountry
         </tr>
         </tr> 
        <tr> 
        <td colspan=\"6\" class=\"topBorder\">    <a href=\"viewdetail.php?m_id=
    $m_id\">View Detail Info</a>
         </tr>
         </table>
        </td>"

  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    56
    Rep Power
    2
    Hi Barry,

    Thanx, I will try that.

    Joseph
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    56
    Rep Power
    2
    I copied and pasted the code into my page. After running the image was not fetched and I did not even get an error message.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    Sydney Australia
    Posts
    183
    Rep Power
    84
    Originally Posted by josephbupe
    I copied and pasted the code into my page. After running the image was not fetched and I did not even get an error message.
    What did you get?

    Can you post the resulting html code here?

IMN logo majestic logo threadwatch logo seochat tools logo