...

View Full Version : Simple elseif help Please!!!



LJackson
12-02-2008, 02:52 PM
Hi All

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


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

LJackson
12-02-2008, 02:58 PM
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

Fumigator
12-02-2008, 03:38 PM
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/

LJackson
12-02-2008, 03:49 PM
Cool Thanks Fumigator :thumbsup::thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum