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 May 6th, 2006, 03:57 PM
twizler twizler is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 1 twizler User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 53 sec
Reputation Power: 0
Parse error: syntax error, unexpected T_ECHO in blah blah on line 219 PLEASE HELP!

Hell I am trying to get a search that I have developed to display the results. However when I test the code I get an error:Parse error: syntax error, unexpected T_ECHO in blah blah on line 219

I have done research and checked out more information on this error. Everyone is telling me its a missing ; or I forgot to end a tag somewhere but I cannot seem to find it!!!! The look_in is a variable that is being populated by a drop down menu on a previous page that a user selects Please help!

Here is the bottom half of my code. Line 219 is the last else if...


PHP Code:
 $result mysql_query($query) or die();


while (
$row mysql_fetch_assoc($result))
{
    if (
$look_in == "General_Needs")
    {
    echo 
$row['General_Title'];
    echo 
$row['General_City'];
    echo 
$row['General_State'];
    echo 
$row['General_Price'];
    echo 
$row['General_Desc'];
        }

    else if (
$look_in == "Cars_Needs")
    {
    echo 
$row['Cars_Title'];
    echo 
$row['Cars_Make'];
    echo 
$row['Cars_Year'];
    echo 
$row['Cars_Color'];
    echo 
$row['Cars_Price'];
    echo 
$row['Cars_City'];
    echo 
$row['Cars_State'];
    echo 
$row['Cars_Desc'];
        }

    else if (
$look_in == "Housing_Needs")
    (
    echo 
$row['Home_Title'];
    echo 
$row['Home_Beds'];
    echo 
$row['Home_Pets'];
    echo 
$row['Home_Own_Rent'];
    echo 
$row['Home_Price'];
    echo 
$row['Home_City'];
    echo 
$row['Home_State'];
    echo 
$row['Home_Desc'];
        }
}
?> 

Last edited by MadCowDzz : May 8th, 2006 at 08:13 AM. Reason: Added [php] tags

Reply With Quote
  #2  
Old May 7th, 2006, 02:55 AM
Icon's Avatar
Icon Icon is offline
Command Line Warrior
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Sep 2005
Posts: 1,021 Icon User rank is Private First Class (20 - 50 Reputation Level)Icon User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 2 Weeks 7 h 49 m 32 sec
Reputation Power: 11
Hmm we may need some more code to spot the error.. The bug might be in that spot bu t way before.. On an unrelated note, there is also the 'elseif' construction instead of 'else if'.

Reply With Quote
  #3  
Old May 7th, 2006, 11:59 AM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 552 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 9 h 1 m 33 sec
Reputation Power: 10
unexpected t_echo error

I suspect that the problem is most likely a missing brace "}". If you don't have a code editor that highlights syntax the easiest way to find out (still a bit tedious I'm afraid) is to use "find" and count all the "{"s and all the "}"s, if there isn't the same number of them, that's the problem. Then it's just a matter of locating the error. As mentioned, the line number given in the error message is not necessarily where the error is, it's where the parser first noticed that there's a problem.

Last edited by Mittineague : May 7th, 2006 at 12:01 PM.

Reply With Quote
  #4  
Old May 8th, 2006, 08:15 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,886 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 19 m 35 sec
Reputation Power: 14
It looks like this block:
Code:
    else if ($look_in == "Housing_Needs")
    (
    echo $row['Home_Title'];
    echo $row['Home_Beds'];
    echo $row['Home_Pets'];
    echo $row['Home_Own_Rent'];
    echo $row['Home_Price'];
    echo $row['Home_City'];
    echo $row['Home_State'];
    echo $row['Home_Desc'];
        } 

Has a regular bracket instead of an opening curly-bracket... I've tried bolding it and coloring it...
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter!
DevArticles Forum Moderator

"The net is a waste of time, and that's exactly what's right about it." -- William Gibson

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Parse error: syntax error, unexpected T_ECHO in blah blah on line 219 PLEASE HELP!


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 - 2014, Jelsoft Enterprises Ltd.

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