You are here: Re: Ordering inserted database values « PHP Programming Language « IT news, forums, messages
Re: Ordering inserted database values

Posted by Andy Hassall on 12/06/98 11:56

On Fri, 25 Aug 2006 16:55:39 GMT, "Frankie" <frankie66@earthlink.net> wrote:

[snip some insert statements]
>But this results in random entries by size.
>
>Is there a way to order these entries? If not, how would I use usort() to
>get the order I want?

Data in a table is unordered - you must always use an "ORDER BY" clause in the
SELECT statement if you want it out in a particular order. There's nothing you
can do on INSERT to guarantee an ordering - it doesn't work like that.

e.g.

select itemNumber, size, inStock
from inStockApparel
order by itemNumber, size

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

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

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