SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: exception

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    exception

    is there any way to make an exception to a specific article from showing in the search ? or in the article's list ?

    i am just kickin ...
    ONLY LaZiO and ArGaNTiNa ...

  2. #2
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Say you have a list of articles you don't want to display
    $list = ($a,$b,...);

    then
    $query = "SELECT articles
    FROM table
    WHERE article_ID NOT IN $list)";

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mmmmmm,

    i have another solution ... i just had out of my mind ...

    i can say:

    PHP Code:
    <?
    $query
    =mysql_query("select from table where id!='$id'");
    ?>
    thats it
    if i dont want to list alot of articles ... i can have them prevented with any loop method.

    am i correct ?!
    Last edited by veron; Oct 19, 2001 at 20:52.
    ONLY LaZiO and ArGaNTiNa ...

  4. #4
    SitePoint Wizard johnn's Avatar
    Join Date
    Mar 2001
    Location
    Southern California, USA
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, give it a try but replace
    !=
    with
    IS NOT

    You can check mysql manual about !=
    I guess they don't allow it.

  5. #5
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by veron
    PHP Code:
    <?
    $query
    =mysql_query("select from table where id!='$id'");
    ?>
    Well, since your not selecting anything, i doubt it'd work
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*


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
  •