SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Oct 2003
    Location
    Florida
    Posts
    264
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't remember the clause

    I can't remember the CLAUSE condtion but heres what i'm trying to do;


    PHP Code:
    $db->query_read("
            SELECT title, id
            FROM tablename
            WHERE id NOT(1,2,3)
            ORDER BY title
    "
    ); 
    Is that right? I want to exclude some ids but get the rest. So if i have.
    "1 2 3 4 5 6" That query will get 4,5,6.

    Hmm, i think i posted in wrong forum

  2. #2
    Tranceoholic lilleman's Avatar
    Join Date
    Feb 2004
    Location
    Írebro, Sweden
    Posts
    2,716
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    WHERE id NOT IN (1,2,3)
    ERIK RIKLUND :: Yes, I've been gone quite a while.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •