evalid Posted May 28, 2008 Share Posted May 28, 2008 Hello, I have a web page which people can post their messages on it. The messages show on the page are from the old time to the recent time. You can select the pages from page 1 to the last page. My question is how to change the messages order, so the message "page 1" show the most recent messages first instead the old messages. For example, the recent messages are in the page 1, then page 2... Here is the web address URL: http://www.uswebcity.com/wish/wish.php And here is part ot the SELECT function in PHP script. Could you please tell me how to change(rewrite) the functions? Thank you. <SELECT NAME="page" style="font-size: 7pt ;font-family: Verdana; background:#808080 url(''); color:#ececec" onChange="ace.submit();" STYLE="BACKGROUND:#808080;COLOR:#ececec"> <? if($wishnum%$show_num==0) $zpage=(int)($wishnum/$show_num); else $zpage=(int)($wishnum/$show_num)+1; for($i=1;$i<=$zpage;$i++){ if($page!=$i){ echo"<option value=$i>page $i</option>"; } else{ echo"<option value=$i selected>page $i</option>"; } } ?></SELECT> . . . Link to comment https://forums.phpfreaks.com/topic/107677-help-php-select-script-web-page/ Share on other sites More sharing options...
craygo Posted May 28, 2008 Share Posted May 28, 2008 I assume the data is from a mysql table. if it is you have not shown us the query which retrieves the messages. Please post that code for more help. Ray Link to comment https://forums.phpfreaks.com/topic/107677-help-php-select-script-web-page/#findComment-551993 Share on other sites More sharing options...
Gighalen Posted May 28, 2008 Share Posted May 28, 2008 Assuming that your paging technique is done by dividing the initial query, just sort the by time/date in your query. SELECT * FROM table WHERE ORDER BY date DESC Link to comment https://forums.phpfreaks.com/topic/107677-help-php-select-script-web-page/#findComment-552017 Share on other sites More sharing options...
evalid Posted May 28, 2008 Author Share Posted May 28, 2008 I assume the data is from a mysql table. if it is you have not shown us the query which retrieves the messages. The web page doesn't have a mysql database. It only has 2 php web pages and a data directory. Link to comment https://forums.phpfreaks.com/topic/107677-help-php-select-script-web-page/#findComment-552037 Share on other sites More sharing options...
prcollin Posted May 28, 2008 Share Posted May 28, 2008 I assume the data is from a mysql table. if it is you have not shown us the query which retrieves the messages. The web page doesn't have a mysql database. It only has 2 php web pages and a data directory. if you need some hosting where you have a cpanel and php and mysql and apache on the server ill give you some space for cheap or nothing depending on your site size Link to comment https://forums.phpfreaks.com/topic/107677-help-php-select-script-web-page/#findComment-552129 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.