Reply to Re: Ordering mysql results

Your name:

Reply:


Posted by Joe Molloy on 08/29/06 02:04

If only it were....

This is purely a presentational issue.

Joe

"Jerry Gitomer" <jgitomer@verizon.net> wrote in message
news:d1NIg.7950$Xl5.3340@trnddc06...
> Joe Molloy wrote:
>> Hi Group,
>>
>> I have a task and I'm interested to see what ideas people have here for
>> the best way of tackling it.
>>
>> I have a table of products. Each of the products is associated with a
>> certain section which is achieved with a foreign key (the section id)
>> linked to the sections table.
>>
>> Now the problem is that when the products are listed in each section the
>> order of their display is important - in other words, products should
>> appear in a definite order when they are displayed - this order is not
>> alphabetical or numerical so a simple ORDER BY clause won't work. It is
>> just the preference of the site owner.
>>
>> I was thinking that there are 2 ways of achieving this.
>>
>> The first would be to add a timestiamp column so that I could order the
>> list by the most recently updated product so that the site owner could
>> manipulate the list into the order they want but that's not very user
>> friendly.
>>
>> The second would be to have the site owner assign a numerical preference
>> manually so that products could be ordered by that numerical preference
>> column but that becomes pretty unfriendly with more than 10 products.
>>
>> I'm sure I'm not the first developer to have this kind of issue to
>> address and I'd be grateful to hear how other people have tackled it.
>>
>> Looking forward to hearing your ideas,
>>
>> Joe
> Based on your description of the problem I would use the first approach if
> the site owner frequently changes the desired sequence. I would use the
> second approach if the desired sequence is fairly stable.
>
> But, before implementing either I would ask the site owner if the order is
> based on some value that can be specified in an ORDER BY clause, for
> example units sold or value of sales.
>
> HTH
> Jerry

[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

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