Anything wrong with
SELECT * FROM story WHERE approved = 1 AND newsId != $newsId AND editionId =
$eid ORDER BY newsSortOrder ASC

dan mccullough
sr. engineer
url:  heathermccullough.com
tf:   866.298.3991
w:   603.444.9808
________________________________
There is no such thing as a problem, unless the servers are on fire.
Sometimes great opportunity comes brilliantly disguised as bad news.

-----Original Message-----
From: John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 20, 2004 9:29 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] get all except 1

Dan McCullough wrote:

> Haven't done this in a while, but here is my question.
> I have 4 stories, and you land on the story page where one story is shown
> and on the side there is a listing of the other 3 stories that are active
in
> that edition.
> So what I would like to do in one query is get the three that are not
shown
> on that page.
>
> So can I do something like
>
> $story_sql="SELECT * FROM story WHERE approved = 1 AND editionId = $eid
> EXCEPT nid = $nid";
>
> $nid is the id of the story whos detail page we are on

SELECT * FROM story WHERE approved = 1 AND editionID = $eid AND nid <> $nid

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to