Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Stupid Parsing "Error"

    Ok, what's making me mad, is that I'm getting a PHP error that's tell me that I have a parsing error. The error reads:

    Parsing error, unexpected $ on line 118.

    Ok, here's line 118:

    Code:
    </html>
    Oh man, that irritates me muchos. What does this mean? I reinstalled the interpreter, I resintalled Abyss, I took out that line, but it just seems to like that line where the </html> originally was. It's making me mad.

    Also, how do you make an array? Is it like:

    $myarray = array("yo", "yoyo", "yoyoyo");?

    Thanks in advance.
    -Obiwan Jabroni
    May the Schwartz be With You

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    check the line before 118. Did you end it with a ";" semicolon???

    I can't tell you how many times that throws me in a fit!

    Good luck.

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the suggestion. I found the error after staring at the code a while just now. It wasn't a semicolon. Actually, it was the fact that about 10 lines back, I had a mismatched "}". I was missing one and that was what was causing the error. Now, as to how to do arrays...?
    -Obiwan Jabroni
    May the Schwartz be With You

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    577
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That array would work fine

    $arrayname = array('value1','value2','value3');
    or
    $arrayname = array();
    $arrayname[0] = 'value1';
    $arrayname[1] = 'value2';

    or using reference names rather than numbers

    $arrayname = array('name1' => 'value1','name2' => 'value2');
    or
    $arrayname['name1'] = 'value1';
    $arrayname['name2'] = 'value2';

    or multidimensionals-

    $arrayname = array(array('valueA','valueB'),array('value1','value2'));
    or
    $arrayname[0][0] = 'valueA';
    $arrayname[0][1] = 'valueB';
    $arrayname[1][0] = 'value1';
    $arrayname[1][1] = 'value2';

    Basically
    Ökii - formerly pootergeist
    teckis - take your time and it'll save you time.

  • #5
    New Coder
    Join Date
    Jun 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ah hah, I see. It's kind of strange having to declare arrays like that (since I came in assuming that PHP would be VERY similar to C++, especially in aspects of variables) but oh well, at least I get it now. Thanks.
    -Obiwan Jabroni
    May the Schwartz be With You

  • #6
    New Coder
    Join Date
    Jun 2002
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You reinstalled things because of a parsing error? LOL... I can't tell you how valuable experiece in debugging can be when it comes to web programming - esp. when the very limited debugging information available isn't even helpful half the time.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •