You are here: Re: [PHP] invert « PHP « IT news, forums, messages
Re: [PHP] invert

Posted by George B on 08/25/05 22:38

Łukasz 'nostra' Wojciechowski wrote:
> 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
>
If I do that... then i get this error
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in myfile name on line 30

and on line 30 it says

while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {

I dont understand what is problem here...

 

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

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