Ask a Question related to Macromedia Dreamweaver, Design and Development.
-
Kevin Spencer #1
Records in Ascending Order
I am using Dreamwaver MX 6.1 with PHP and a MySQL database. I have a
page that displays upcoming events and they are arranged by date in
ascending order. See Below...
05/21/2003
05/23/2003
06/07/2002
My question and problem is this...I have a repeating region that displays 3
of them at a time on the page. What I would like to happen is have them
displayed in the order that I listed above, but when I enter another one
(say for 07/15/2003), I would like 05/21/2003 to be removed from the page
(not from the database, just the page that has the repeating region on it.)
Does that make any sense? I just want the oldest date to be removed from
the page and have the next most current date move up in it's place (which
would be 5/23/2003). Any suggestions on how I can do this? See Example
below. I want them to show up like this In Ascending order, not in
Descending order
Like This
05/21/2003
05/23/2003
06/07/2002
Not Like this
06/07/2002
05/23/2003
05/21/2003
And when I insert a new date I want it to look like this (see below) and
have the oldest record at the top, with the 05/21/2003 not being displayed
anymore (because these would now be the current 3)
05/23/2003
06/07/2002
07/15/2003
Thanks in advance.
-Kevin-
Kevin Spencer Guest
-
ascending delay
Hi, We have implemented a system based on FMS for live audio/video conferencing. The problem is that if number of attenders in one session is... -
php/mysql query insert values into enters the records in reverse order
I'm loading tab delimited lines from a txt file using php and running a query for each line to enter the data into a mysql database. However the... -
change/swap order of two records in access
How can I efficiently swap order of two records sorted by an autonumber. Access db. Primary key is an autonumber. I'm given a record ID... -
Updating records in order (into an order)
I'm storing questions for a user-defined quiz. I can store them in the order they are entered without any problem. But... The user needs to have... -
Sort Ascending numerically?
I'm sorry if this has been asked here dozens of times before...I'm sure it has! But would someone please tell me how do you get a table to list... -
Pistolfire99 webforumsuser@macromedia.com #2
Re:Records in Ascending Order
You can use the SQL Syntax called LIMIT and ORDER BY. Here is an example.
--------------------------------------------------------------------------------------------------
SELECT autoID, time, event FROM table1 ORDER BY time ASC LIMIT 3;
--------------------------------------------------------------------------------------------------
LIMIT 3 limits the number of results to display, you can put any number you like.
ORDER BY time ASC takes 2 arguments, first is column name that you want to order by and the second is whether you want the data ordered ascending or descending. For ascending you use ASC and for descending you use DESC
Regards,
Pistolfire99
Server Model:- PHP_MySQL + Apache2
[url]http://www.i2l2.com/[/url]
Pistolfire99 webforumsuser@macromedia.com Guest



Reply With Quote

