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 4 of 4
  1. #1
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,098
    Thanks
    297
    Thanked 12 Times in 12 Posts

    Exclamation Simple elseif help Please!!!

    Hi All

    For some reason i cant get this simple piece of code to work

    PHP Code:
        print $feedID;
        if (
    $feedID == '1' and $rssIndividual == ""){
        print 
    "no feed";
        }
        elseif (
    $feedID == '1' and $rssIndividual <> ""){
        print 
    "feeds";
        }    
        elseif (
    $feedID == '2' and $rssIndividual == ""){
        print 
    "no rss feed";
        }
        elseif (
    $feedID == '2' and $rssIndividual <> ""){
        print 
    "rss feeds";
        }
        else {
        print 
    "error"
    if i have a record in the database where by the $feedID = 2 and $rssIndividual = a web address so using the above the out put should be "rss feeds" but it is displaying "feeds" instead is there something wrong with my code above?

    many thanks
    Luke Jackson

  • #2
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,098
    Thanks
    297
    Thanked 12 Times in 12 Posts
    Its ok ive sorted it out now thanks i was missing out the == i have now ammended the above code so it is correct.

    its so much easier to find mistakes on here than on dreamweaver is there a program i can use to easier check my code?

    thanks Guys
    Luke

  • #3
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    The Eclipse editor syntax checks your code as you type... it's a little quirky and kind of intimdating at first, but once you get your toes dug in you can see the benefits.

    http://www.eclipse.org/

  • #4
    Senior Coder
    Join Date
    Jun 2008
    Location
    Cornwall
    Posts
    2,098
    Thanks
    297
    Thanked 12 Times in 12 Posts
    Cool Thanks Fumigator


  •  

    Posting Permissions

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