Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

Inserting an OR/LIKE statement.

Posted 11 Jun 2002 23:19:03
1
has voted
11 Jun 2002 23:19:03 Russell Marshall posted:
I am using the show/hide region behaviour to add a security level to a site and have a little problem. The users of the site can be both clients and employees. All user information is stored in a table called Clients and the field name is permission.

All users are assign a permission level when registering.

The levels are Client, Sales, Admin and Superior.

I want the admin area of the site to be accesible by all levels except Client.

The SQL that works for admin staff only is as follows.

Username and password are passed from the login page.

SELECT *
FROM Clients
WHERE username='varUser' AND password='varPass' AND permission='admin'

What does the SQL need to be modified to, to include Sales and Superior also.

My quess was

SELECT *
FROM Clients
WHERE username='varUser' AND password='varPass' AND {permission='admin' OR permission='sales' OR permission='Superior'}

The logic (I think) sounds fine but I have crashed and burned on the syntax.

Many Thanks

Russell




Replies

Replied 12 Jun 2002 00:28:34
12 Jun 2002 00:28:34 Andrew Watson replied:
SELECT *
FROM clients
WHERE Username='varUser' AND Password='varPass' AND Permission='admin' OR Permission='sales' OR Permission='Superior';

this will work..

Cheers
Leed

:: Son, im Thirty.... ::

Reply to this topic