Click to See Complete Forum and Search --> : Problem with IF statement


screaming_banjo
06-15-2005, 11:50 AM
Hi,

I have a message which I only want to show if there is a search result present, I don't want it to show if a particular UserID is logged in or the search hasn't returned any results.

If there are no search results then an error message is output. I'm stumped witht the logic for this, here's the code that I've got:

<% IF rsusernow("UserID") <> "227" OR errormessage > "" then %>
<br>Name of your Department incorrect?......Or have you been listed in the wrong department?......<strong><a href="mailto:fake@fake.co.uk" title="Click to email Mandy">email Mandy</a></strong> to get it changed.
<% END IF %>

The first part of the condition works, no message if I'm logged in as 227, however the second part doesn't. I've no idea what other condition to use for the second part......can anyone help?

Thanks so much!

phpnovice
06-15-2005, 12:11 PM
Change OR to AND.

screaming_banjo
06-15-2005, 02:28 PM
Thanks, will give that a go when I'm back at work tomorrow although I'm sure I tried 'and' without success, but maybe not, had a few things go wrong today....so maybe not, it's been one of 'those' days:(

screaming_banjo
06-16-2005, 03:58 AM
Changed it to AND...success! I was sure I'd tried it yesterday....I was working on so many bits I guess my brain got a bit fried! Working now, thank you so much! :)

phpnovice
06-16-2005, 08:02 AM
Cheers.