You are here: Re: MySQL list, relative to one post. « PHP Programming Language « IT news, forums, messages
Re: MySQL list, relative to one post.

Posted by Joshie Surber on 11/16/05 05:52

> 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, you may try "where
id<CURRENTID+2 OR id>CURRENTID+2 (my brain isn't working logicly now...
you may need to flip the + and - signs)

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.

Hope this gives you some ideas.

 

Navigation:

[Reply to this 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

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