PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 23rd, 2005, 11:39 AM
gdogfunk gdogfunk is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 2 gdogfunk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 18 sec
Reputation Power: 0
Parse error: unexpected "}"

Howdy folks!

I've been getting better at PHP for my own usage and am having a lot of fun with it. However, as of last night I have stumbled across a problem that I cannot seem to remedy.

I have created an admin page that lets me enter new info for various pages of my bands website and everything works great. I have the main site calling the results and they format as expected. Well, last night I decided to build my own PHP guestbook based on the layout of the CGI guestbook provided with my hosting. I duplicated my PHP file for another page on the site that was working fine (reviews.php) and named it guestbook.php. When I uploaded the file, I should have seen an exact duplicate of the reviews.php, but instead, I got the error below:

Parse error: parse error, unexpected '}' in /hsphere/local/home/agfagf/agruesomefind.com/php/guestbook.php on line 70

I refreshed the reviews.php and it seemed to work fine....Then, I added a simple <hr width="640"> to the bottom of the reviews.php (formatting for look and feel) and reuploaded the reviews.php. Now, I get the same error for the reviews.php without having changed ANY of the php code.

Why would something work one minute and not the next with absolutely NO change?

Here is the code for reviews.php:

PHP Code:
 php 

mysql_connect 
("****""****""****");
   
mysql_select_db (*********);

$result mysql_query ("SELECT * FROM agf_reviews ORDER BY title
                         
                         "
);

if (
$row mysql_fetch_array($result)) {

do {
   print 
'<table border="0" cellspacing="5" cellpadding="0" style="color: #fff;">';

echo 
"<tr>\n";
                echo 
"<td><b><font color='yellow'>{$row ["title"]}</font></b></td>\n";
                echo 
"</tr>\n";
echo 
"<tr>\n";
                echo 
"<td><i>{$row ["reviewer"]}</i> </td>\n";
                echo 
"</tr>\n";
echo 
"<tr>\n";
echo 
"<td><a href='http://{$row ["website"]}'target='_blank'>{$row ["name"]}</a> </td>\n";
echo 
"</tr>\n";
echo 
"<tr>\n";
                echo 
"<td>{$row ["review_text"]} </td>\n";
echo 
"</tr>\n";
echo 
"<tr>\n";

echo (
"<br>");

} while(
$row mysql_fetch_array($result)); 

print 
"</table>";

print 
"-------------------------------------------------------------"

} else {

print 
"Nothing has been entered yet";




Any help would be greatly appreciated!!! Thanks!

Ryan

Reply With Quote
  #2  
Old January 24th, 2005, 09:46 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
you're likely missing a semi-colon or didn't close the quotes properly.

a line like this: echo "<td>{$row ["review_text"]} </td>\n";
might be better written as: echo "<td>{$row ['review_text']} </td>\n";

Which line is line 70?

Reply With Quote
  #3  
Old January 24th, 2005, 12:20 PM
Madpawn Madpawn is offline
My beat is correct.
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 339 Madpawn User rank is Private First Class (20 - 50 Reputation Level)Madpawn User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Days 22 h 3 m 33 sec
Reputation Power: 5
The print '------------------... line is missing the semicolon.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Parse error: unexpected "}"


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT