SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2000
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am getting parse errors when I try to use the following
    code


    $result = mysql_query($sql) or die("Couldn't execute query.");
    $number = MYSQL_NUMROWS($result);

    switch ($number) {
    case "0" :
    include('/refunknown.php3');
    case "1" :
    include('/refknown.php3');
    };


    I guess I can't see the wood for the trees ! Anyone spot a syntax problem ?

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If there will only be two choices refunknown.php3 and refknown.php3 you might want to do it this way:

    $result = mysql_query($sql) or die("Couldn't execute query.");
    if (mysql_num_rows($result) > 0) {
    include('/refknown.php3');
    }
    else {
    include('/refunknown.php3');
    }


    Please don't PM me with questions.
    Use the forums, that is what they are here for.


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
  •