Reply to Re: [PHP] invert

Your name:

Reply:


Posted by £ukasz 'nostra' Wojciechowski on 08/25/05 22:32

W odpowiedzi na maila (21:21 - 25 sierpnia 2005):

> I have written a shoutbox, and it works great, but I am wondering...
> When a user posts a shout it goes below the first shout. Like the
> auto_increment puts the ID up higher. I need it to go about the first
> shout, so like the auto_increment would invert. Someone told me this is
> possible through PHP. Is that true? and if so how do you do it?

mysql_query('SELECT * FROM table ORDER BY increment_field DESC');

http://dev.mysql.com/doc/mysql/en/order-by-optimization.html


or

get all output from DB into array and use array_reverse();

http://us2.php.net/manual/pl/function.array-reverse.php

--
pozdrawiam
Łukasz "nostra" Wojciechowski
gg.1028640 * icq.23059512


----------------------------------------------------------------------
Startuj z INTERIA.PL! >>> http://link.interia.pl/f186c

[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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация