PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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 July 3rd, 2009, 01:17 PM
SphinxCorp's Avatar
SphinxCorp SphinxCorp is offline
Epically Godly figure
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: Windows :p
Posts: 240 SphinxCorp Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 Days 13 h 24 m 36 sec
Reputation Power: 0
Can't find error

Where am I going wrong with this statement:

Code:
if (subfind($row[namefind($array[0], $FilterColumn)], $FilterTerm) == $Include)
{
    //stuff
}


Here is the error:
Code:
PHP Parse error:  syntax error, unexpected '(', expecting ']' in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\\########.php on line ##
__________________
This is my sig.

Reply With Quote
  #2  
Old July 3rd, 2009, 02:03 PM
acidfourtyfive's Avatar
acidfourtyfive acidfourtyfive is offline
Since 439000000
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: May 2004
Location: Canada
Posts: 1,095 acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level)acidfourtyfive User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 16 h 45 m 15 sec
Reputation Power: 117
Well I was wrong.

It seems to have something to do with: $row[namefind($array[0], $FilterColumn)]

Can't quite pick it out without more code.
__________________

Last edited by acidfourtyfive : July 3rd, 2009 at 02:14 PM.

Reply With Quote
  #3  
Old July 3rd, 2009, 02:21 PM
SphinxCorp's Avatar
SphinxCorp SphinxCorp is offline
Epically Godly figure
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: Windows :p
Posts: 240 SphinxCorp Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 Days 13 h 24 m 36 sec
Reputation Power: 0
which part do you want?
Comments on this post
Arty Ziff agrees: Let's try to dig you out...

Reply With Quote
  #4  
Old July 3rd, 2009, 05:14 PM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Dec 2004
Posts: 3,311 E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 42 m 14 sec
Reputation Power: 2243
The error isn't in the code you posted. Post the 10 lines that come before it.

Reply With Quote
  #5  
Old July 3rd, 2009, 08:42 PM
SphinxCorp's Avatar
SphinxCorp SphinxCorp is offline
Epically Godly figure
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: Windows :p
Posts: 240 SphinxCorp Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 Days 13 h 24 m 36 sec
Reputation Power: 0
found the error. You were right the first time, can't use a function as array key

Reply With Quote
  #6  
Old July 3rd, 2009, 11:46 PM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Contributing User
Dev Shed Loyal (3000 - 3499 posts)
 
Join Date: Dec 2004
Posts: 3,311 E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 19th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 11 h 42 m 14 sec
Reputation Power: 2243
What version of PHP are you using? In 5.2 there is nothing that prevents you from using a function (return value) as an array key.
Comments on this post
kicken agrees!

Last edited by E-Oreo : July 4th, 2009 at 12:01 AM.

Reply With Quote
  #7  
Old July 4th, 2009, 02:54 AM
kicken's Avatar
kicken kicken is offline
Wiser? Not exactly.
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: May 2001
Location: Ft Myers, FL
Posts: 4,567 kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)kicken User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 184942 Folding Title: Super Ultimate Folder - Level 1Folding Points: 184942 Folding Title: Super Ultimate Folder - Level 1Folding Points: 184942 Folding Title: Super Ultimate Folder - Level 1Folding Points: 184942 Folding Title: Super Ultimate Folder - Level 1Folding Points: 184942 Folding Title: Super Ultimate Folder - Level 1Folding Points: 184942 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 3 Weeks 6 Days 23 h 48 m 11 sec
Reputation Power: 1273
Send a message via ICQ to kicken Send a message via AIM to kicken Send a message via MSN to kicken
Quote:
Originally Posted by E-Oreo
What version of PHP are you using? In 5.2 there is nothing that prevents you from using a function (return value) as an array key.


Functions as array keys seem to work fine in PHP 4 even with my simple test:
Code:
kicken@bonzi:~$ php -v
PHP 4.4.9 (cli) (built: Jul  4 2009 02:53:09)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

kicken@bonzi:~$ php -r '$a=array(); $a[max(5,6)] = "hello"; var_dump($a);'
array(1) {
  [6]=>
  string(5) "hello"
}
__________________
Spidermonkey Tutorial; Fight me: http://aoeex.mybrute.com
http://www.aoeex.com/gmap.php - Put yourself on the map (Now Updated!)


Reply With Quote
  #8  
Old July 4th, 2009, 03:18 AM
ryon420's Avatar
ryon420 ryon420 is offline
Spare some change?
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2006
Location: The place next to the place next to me
Posts: 3,872 ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)ryon420 User rank is General 16th Grade (Above 100000 Reputation Level)  Folding Points: 1496 Folding Title: Novice Folder
Time spent in forums: 8 Months 1 Week 3 Days 9 h 19 m 15 sec
Reputation Power: 2027
Send a message via MSN to ryon420 Send a message via Google Talk to ryon420
This is what you are doing: You are asking "I can't feel my foot, here is a picture of it. What's wrong?" But what you fail to do is take a picture of your whole leg. If you had taken that picture, we'd see you have your leg blown off.

I somehow doubt you found the error. I think you just got really lucky, like I'm gonna do tonight! Can I get an amen?
__________________
Ryon's Laws of Stupidity:
  • Stupidity in a closed system is constant, it can neither be created nor destroyed
  • Stupidity in a closed system will increase the entropy
  • Stupidity = Arrogance+Ignorance

Last edited by ryon420 : July 4th, 2009 at 03:21 AM.

Reply With Quote
  #9  
Old July 4th, 2009, 10:21 AM
SphinxCorp's Avatar
SphinxCorp SphinxCorp is offline
Epically Godly figure
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Location: Windows :p
Posts: 240 SphinxCorp Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 Days 13 h 24 m 36 sec
Reputation Power: 0
-.- I put the erroneous statement in a variable assignment, and the problem disappeared. Interpret that how you will.


BTW: Some might consider it cocky that you assume I absolutely need your help, as opposed to looking for some friendly advice.


P.S.: 5.2.10
Comments on this post
ryon420 disagrees: That sounds rather post hoc, but whatever. I don't care.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Can't find error


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




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek