View Full Version : Simple elseif help Please!!!

12-02-2008, 03: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

12-02-2008, 03: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

12-02-2008, 04: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.


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