Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
This Error Is Driving Me Mad
Old 07-20-2003, 04:28 PM This Error Is Driving Me Mad
david's Avatar
King Spam Talker

Posts: 1,314
Location: Glasgow, UK
Trades: 0
Please help me someone!!!!

I've been coding for a while so I might be missing something obvious, but I'm getting a PHP parse error in my code. It's brining up the last line in this snippet as the error.

PHP Code:
if($gpd1n<1) {
    exit;
} else {
    
$i=0;

    
$currplan=mysql_result($gpd1r,$i,"planid");
    
$pid=-1;
    
$currfeature=mysql_result($gpd1r,$i,"featureid");
    
    while(
$currfeature!="")
        
$pid++;
        for(
$x=0$x<=$sizfeattab$x++) {
            if(
$feattab[0][$x]==$currfeature) {
                
$feattab[$pid+3][$x]="Y";
                if(
$i!=$gpd1n) {
                    
$i++;
                    
$currfeature=mysql_result($gpd1r,$i,"featureid");
                    
$currplan=mysql_result($gpd1r,$i,"planid");
                } else {
                    
$currfeature="";
                }
            } else {
                
$feattab[$pid+3][$x]="N";
            }
        }
    }
        

    
    if(
$feature['lastcat']!=$feature['category']) {
        
$feattab[1][$i]=$feature['category'];
    } else {
        
$feattab[1][$i]="&nbsp;";
    }
    
    
$feattab[2][$i]=$feature['name'];
    
$feattab[0][$i]=$feature['id'];
            
    
$feature['lastcat']=$feature['category'];
    

Please help! This is driving me mad!
__________________

Please login or register to view this content. Registration is FREE
- Everything a webmaster needs - for free

Please login or register to view this content. Registration is FREE
- Free web hosts reviewed and rated

Please login or register to view this content. Registration is FREE
- Impartial hosting directory - Add your host today for FREE
david is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-22-2003, 12:36 PM
theblt's Avatar
Super Talker

Posts: 119
Trades: 0
Wow that's a toughy. I'm looking at the code and I can't find anything at all. May I recommend that you visit Macromedia's website at http://www.macromedia.com . Check out their forums and newsgroups and see if they might know over there. They got some pretty smart coders who visit the newsgroups regularly.
theblt is offline
Reply With Quote
View Public Profile Visit theblt's homepage!
 
Old 07-22-2003, 02:07 PM
eConcept-Web's Avatar
Skilled Talker

Posts: 82
Trades: 0
what is the error ???
__________________
======================================
Web Hosting and Web Design Services
Site:
Please login or register to view this content. Registration is FREE

eMail:
Please login or register to view this content. Registration is FREE

MSN:
Please login or register to view this content. Registration is FREE

======================================
eConcept-Web is offline
Reply With Quote
View Public Profile Visit eConcept-Web's homepage!
 
Old 07-22-2003, 02:41 PM
david's Avatar
King Spam Talker

Posts: 1,314
Location: Glasgow, UK
Trades: 0
It was a parse error in the last line of the code.

Thanks for the idea, theblt. I'll need to check them. I'm OK for now, though, rewrote the system a different way and it does what I need, so I'm happy!
__________________

Please login or register to view this content. Registration is FREE
- Everything a webmaster needs - for free

Please login or register to view this content. Registration is FREE
- Free web hosts reviewed and rated

Please login or register to view this content. Registration is FREE
- Impartial hosting directory - Add your host today for FREE
david is offline
Reply With Quote
View Public Profile
 
Old 07-27-2003, 09:42 PM
Cagez's Avatar
Skilled Talker

Posts: 62
Trades: 0
I don't like your stye of coding it makes it hard to spot missing {}'s.

An error on the last line usually means you forgot a curly somewhere. I think you forgot a { after your while

PHP Code:
while($currfeature!="")
// here? I'm not sure if you included a }, too lazy to check :-P 
Cagez is offline
Reply With Quote
View Public Profile
 
Old 07-28-2003, 06:20 AM
david's Avatar
King Spam Talker

Posts: 1,314
Location: Glasgow, UK
Trades: 0
Well spotted Cagez!

You're proably right about the coding style!
__________________

Please login or register to view this content. Registration is FREE
- Everything a webmaster needs - for free

Please login or register to view this content. Registration is FREE
- Free web hosts reviewed and rated

Please login or register to view this content. Registration is FREE
- Impartial hosting directory - Add your host today for FREE
david is offline
Reply With Quote
View Public Profile
 
Old 08-15-2003, 09:05 AM
Skilled Talker

Posts: 67
Location: New Zealand
Trades: 0
A good trick or tip is to always comment your ending bracket. Eg:


PHP Code:
while(1) {
    if (
== 3) {
        print 
"does anyone care?";
    } 
// if end
// while end 
But really I like to use the following style

PHP Code:
while(1)
    {
    if (
== 3)
        {
        print 
"does anyone care?";
        }
    } 
__________________

Please login or register to view this content. Registration is FREE
- PayPal Accepted
PhilG is offline
Reply With Quote
View Public Profile
 
Old 08-16-2003, 01:41 PM
Skilled Talker

Posts: 52
Location: Leamington, UK
Trades: 0
I find the best way of indenting code is to indent after the brace like this:

PHP Code:
if ($foo == $bar)
{
    echo 
$bar;

but this is just preference and the way my editer auto indents the code
__________________
Stewart McIntosh -
stewis is offline
Reply With Quote
View Public Profile
 
Old 08-16-2003, 05:01 PM
Cagez's Avatar
Skilled Talker

Posts: 62
Trades: 0
I do it that way too stewis, I find it easier to differentiate code blocks that way.
Cagez is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to This Error Is Driving Me Mad
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.57709 seconds with 12 queries