SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    $postcount++; koomann's Avatar
    Join Date
    Feb 2003
    Location
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unexpect $ When there isn't even one there..?

    I get this error:
    Parse error: parse error, unexpected $ in /home/virtual/site11/fst/var/www/html/practice/list.php on line 31

    When line 31 is simply this:
    PHP Code:
    ?> 
    I'm baffelled here...

  2. #2
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    have you missed a } in there somewhere? or left a quote open?

  3. #3
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Missed a semicolon?
    Mike
    It's not who I am underneath, but what I do that defines me.

  4. #4
    $postcount++; koomann's Avatar
    Join Date
    Feb 2003
    Location
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm, checked through, and I was missing a }, but I replaced it and got the same error.

  5. #5
    SitePoint Member insomica's Avatar
    Join Date
    Apr 2003
    Location
    Houston, TX
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you show a few more lines of code ?
    BitWise Sreen Name - insomica
    File Size of Bitwise is only 595k.
    They are working on version for linux.
    http://www.schwippy.com/insomica/


  6. #6
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Yeah, paste your code here.
    Mike
    It's not who I am underneath, but what I do that defines me.

  7. #7
    $postcount++; koomann's Avatar
    Join Date
    Feb 2003
    Location
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php
    // connect 
    $db = @mysql_connect("localhost""username""password");
     if (!
    $db) {
     echo( 
    "Unable to connect to the database at this time" );
     exit();
    }
    // select
    $dbselect = @mysql_select_db('star-craftx_com');
    if (!
    $dbselect) {
    echo 
    'Unable to select database.';
    exit();
    }

    $name_result = @mysql_query("SELECT name FROM clans");
     if (!
    $name_result) {
      echo 
    "<p>Error Selecting the Clan's Name: " mysql_error()."</p>";
      exit();
     while (
    $clans mysql_fetch_array($name_result)) {
      
    $clansArray[] = array ('clanName' => $clans['name']);
     } 

    $channel_result = @mysql_query("SELECT channel FROM clans");
     if(!
    $channel_result) {
      echo 
    "<p>Error Selecting channel: " mysql_error()."</p>";
      exit();
     }
    ?>
    It isn't complete yet, I was just checking to see if everything was working OK, then it just happened.
    Last edited by naramation; Apr 29, 2003 at 16:47.

  8. #8
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    UK
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this:

    PHP Code:
    <?php
    // connect 
    $db = @mysql_connect("localhost""username""password" );
    if (!
    $db) {
    echo( 
    "Unable to connect to the database at this time" );
    exit();
    }
    // select
    $dbselect = @mysql_select_db('star-craftx_com');
    if (!
    $dbselect) {
    echo 
    'Unable to select database.';
    exit();
    }

    $name_result = @mysql_query("SELECT name FROM clans" );
    if (!
    $name_result) {
    echo 
    "<p>Error Selecting the Clan's Name: " mysql_error()."</p>";
    exit();
    }

    while (
    $clans mysql_fetch_array($name_result)) {
    $clansArray[] = array ('clanName' => $clans['name']);


    $channel_result = @mysql_query("SELECT channel FROM clans" );
    if(!
    $channel_result) {
    echo 
    "<p>Error Selecting channel: " mysql_error()."</p>";
    exit();
    }
    ?>
    Come one, come all!
    I have a dedicated server.
    Need hosting. Contact me !
    Very empty dedicated server !

  9. #9
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Not a good habit to post your password I've edited it for you.
    Mike
    It's not who I am underneath, but what I do that defines me.

  10. #10
    SitePoint Member insomica's Avatar
    Join Date
    Apr 2003
    Location
    Houston, TX
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kaizen what did you change?
    BitWise Sreen Name - insomica
    File Size of Bitwise is only 595k.
    They are working on version for linux.
    http://www.schwippy.com/insomica/


  11. #11
    SitePoint Zealot
    Join Date
    Dec 2001
    Location
    UK
    Posts
    112
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by insomica
    Kaizen what did you change?
    I added a missing '}'.
    Come one, come all!
    I have a dedicated server.
    Need hosting. Contact me !
    Very empty dedicated server !

  12. #12
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ah, 3rd if statement. Good ctach.
    Mike
    It's not who I am underneath, but what I do that defines me.


Bookmarks

Posting Permissions

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