PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 28th, 2012, 01:19 AM
josephbupe josephbupe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 56 josephbupe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 10 m 2 sec
Reputation Power: 1
PHP-General - 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:

Quote:
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

Reply With Quote
  #2  
Old November 28th, 2012, 02:16 AM
Timmeyy Timmeyy is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 18 Timmeyy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 55 m 59 sec
Reputation 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> '

Reply With Quote
  #3  
Old November 28th, 2012, 06:56 PM
BarryG BarryG is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Location: Sydney Australia
Posts: 134 BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level)BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level)BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level)BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level)BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level)BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level)BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 10 h 2 m 37 sec
Reputation Power: 83
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>"


Reply With Quote
  #4  
Old November 28th, 2012, 10:58 PM
josephbupe josephbupe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 56 josephbupe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 10 m 2 sec
Reputation Power: 1
Hi Barry,

Thanx, I will try that.

Joseph

Reply With Quote
  #5  
Old November 29th, 2012, 04:34 AM
josephbupe josephbupe is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 56 josephbupe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 10 m 2 sec
Reputation Power: 1
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.

Reply With Quote
  #6  
Old November 29th, 2012, 03:00 PM
BarryG BarryG is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2011
Location: Sydney Australia
Posts: 134 BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level)BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level)BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level)BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level)BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level)BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level)BarryG User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 3 Days 10 h 2 m 37 sec
Reputation Power: 83
Quote:
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?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-General - Parse error:syntax error, unexpected '/'

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap