Skip to main content
Participant
January 4, 2008
Question

Conditional statement ASP

  • January 4, 2008
  • 1 reply
  • 540 views
I want to show information from a database using 2 WHERE statements.
WHERE cat='restaurant'
WHERE show='True'
I have it working to show cat but I also want it to show information based on show as well.
I tried WHERE cat='restaurant' AND show='True'
but it did not work.
What I am doing is setting up a form so when anyone adds anything it will not show until I authorise it. The initial state for show is False.
Are there any tutorials for this.
Thanks.
This topic has been closed for replies.

1 reply

Inspiring
January 4, 2008
sccs wrote:
> I want to show information from a database using 2 WHERE statements.
> WHERE cat='restaurant'
> WHERE show='True'
> I have it working to show user but I also want it to show information based on
> mail as well.
> I tried WHERE cat='restaurant' AND show='True'
> but it did not work.
> What I am doing is setting up a form so when anyone adds anything it will not
> show until I authorise it. The initial state for show is False.
> Are there any tutorials for this.
> Thanks.
>

When you wrap True like this 'True' it is treating it as string, not a
boolean condition, all you need to do is drop the quotes so it is like this:

WHERE cat = 'restaurant' AND show = True

Steve
sccsAuthor
Participant
January 4, 2008
Thanks. I will give that a go.
On another note.
When a user submits a form from my site it adds it to the database as wanted. I then send the user to a confirm page. That page then sends me an e-mail to say a form has been filled in and added to the database. Is there a way of adding the senders name taken from the form to the email.