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:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old August 4th, 2004, 04:11 PM
Nick novalis Nick novalis is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 Nick novalis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post Parse error

Hey, Im a total newbie, and I was wondering if anyone could suggest why this line of php is giving me a parse error, and suggest possible solutions.




if((substr_count($Urow['user_items'],"ß".$row2['itemneeded']."fi") > 0) && ($ITrow['battle_effect'] <= $Urow['user_statlevel']) && ($ITrow['req_att'] <= $Urow['user_att']) && ($ITrow['req_def'] <= $Urow['user_def']) && ($ITrow['req_mst'] <= $Urow['user_mst']) && ($ITrow['req_ata'] <= $Urow['user_ata']) && ($ITrow['req_evp'] <= $Urow['user_evp']) && ($ITrow['class'] LIKE '%"."ß".$Urow[user_class]."fi"."%' OR $ITrow['class'] = 'ßALLfi'))

Reply With Quote
  #2  
Old August 5th, 2004, 02:45 AM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 6
Yes its formatted horribly

I suggest spacing it out some, put the different if conditions on different lines, and place what is run if the condition is true on a line by itself. That will go a long way to helping you find the problem.

-KM-

Reply With Quote
  #3  
Old August 5th, 2004, 05:13 AM
Itsacon's Avatar
Itsacon Itsacon is offline
Command Line Warrior
Click here for more information
 
Join Date: Aug 2004
Location: Sector ZZ9 Plural Z Alpha
Posts: 956 Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)Itsacon User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2Folding Points: 682581 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 6 Days 8 h 23 m 34 sec
Reputation Power: 4
Send a message via ICQ to Itsacon
What kode_monkey means is making it look like this:

PHP Code:
if(
    (
substr_count($Urow['user_items'], "ß".$row2['itemneeded']."fi") > 0
        && 
    (
$ITrow['battle_effect'] <= $Urow['user_statlevel']) 
        && 
    (
$ITrow['req_att'] <= $Urow['user_att']) 
        && 
    (
$ITrow['req_def'] <= $Urow['user_def']) 
        && 
    (
$ITrow['req_mst'] <= $Urow['user_mst']) 
        && 
    (
$ITrow['req_ata'] <= $Urow['user_ata']) 
        && 
    (
$ITrow['req_evp'] <= $Urow['user_evp']) 
        && 
    (
$ITrow['class'LIKE '%"."ß".$Urow[user_class]."fi"."%' OR $ITrow['class'] = 'ßALLfi')



Now we easily see the problem, which is on the last row of the statement.
PHP does not know the 'LIKE' statement, which comes from SQL.
I assume that some code is missing between the $ITrow['class'] and the LIKE, a quote (") if nothing else.

Good luck

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Parse 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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway