62 users online (1 members and 61 guests)  


  Results 1 to 2 of 2

Related

  1. How to write if statement in MySQL    Forum: PHP Forum
    Replies: 2
  2. Syntax for Select Statement    Forum: Databases
    Replies: 2
  3. Replies: 2
  4. Select Case SQL Statement...    Forum: Databases
    Replies: 7
  5. Replies: 0
  1. #1
    beyondflash's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2005
    Posts
    1

    MySQL Select statement

    I have a database that has a column of int named crsnum.

    I need to select data from this db omiting certian crsnum's, and a certin email match from the email field example:

    "SELECT * FROM login
    WHERE (Email = '$email') ORDER BY ID DESC";

    Works great but I need to add " WHERE Crsnum != 1,3,6,9,19 " so these crsnums are omited from the select.

    Any ideas?

    Thanks in advance.

  2. #2
    vinyl-junkie's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    721

    Re: MySQL Select statement

    Here's what that should look like:

    Code:
    "SELECT * FROM login 
    WHERE (Email = '$email') 
    AND Crsnum NOT IN (1,3,6,9,19)
    ORDER BY ID DESC";



Tags for this Thread