Reply to Re: MySQL list, relative to one post.

Your name:

Reply:


Posted by Sandman on 11/16/05 17:10

In article <1132113150.201641.49730@g44g2000cwa.googlegroups.com>,
"Joshie Surber" <joshiesurber@gmail.com> wrote:

> > have a smart SQL qquery that will fetch it correctly for me in one pass?
>
> If you are fairly sure that the IDs are sequential

Well, had you looked at my example data, you would have seen they are not. :P

> If they aren't sequential, make an educated guess about how
> insequential they are and grab 10 or so on each side and filter out all
> but the five you want in your script. It is a lot faster to grab a lot
> of stuff in one query and filter it in your script than to grab a
> little stuff in two or more queries.

"lots of stuff" could mean tens of thousands of posts, so that's not a good
idea.

what I would like is something like this:

select * from blog where member = 12 and category = 'Sports' and id = 12345
limit -5, 5;







--
Sandman[.net]

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация