View Full Version : SELECT Function PHP Script

07-10-2008, 05:26 PM

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, page 2, then page 3...

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"> <?
echo"<option value=$i>page $i</option>";
echo"<option value=$i selected>page $i</option>";


Shopping, Music & Entertainment
>> www.USWebCity.com <<

07-10-2008, 05:37 PM
If I understand correctly, you want to keep it going from page 1 to MAX, but you want page 1 to have the newest content instead of the oldest?

If that's so, then the issue isn't here but with your database select. What database are you using?

With SQL, you can use something like

SELECT (columns) FROM `(table)` ORDER BY (col to order by) (ASC/DESC)

I'm not sure how your database is setup, but for example, when I have things with dates, I just ORDER BY `date` DESC to get the newest first.

07-11-2008, 09:36 PM
It doesn't have a database or SQL. All the messages are store in one directory only.

07-13-2008, 01:46 PM
Hey man i might be able to help you out.

I'll need to see your current working code :)

07-14-2008, 12:52 PM
I think what Keleth and dicegame are getting at is trying to figure out how the results are being grabbed. There is some type of script within your php that is saying grab "X" files from this place, and then your script to determine what option type it is gets ran.

So if you can find where in your page the files are being grabbed, either try to figure out where the "query" is being performed on the file directory, or post the code here wrapping it inside

07-15-2008, 06:26 AM
Why would you not use a database for this, this would be much easier if you had a database in the backend.