Professional Web Applications Themes

Records in Ascending Order - Macromedia Dreamweaver

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 ...

  1. #1

    Default 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

  2. #2

    Default 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

Similar Threads

  1. ascending delay
    By Deniom in forum Macromedia Flash Flashcom
    Replies: 2
    Last Post: April 11th, 12:22 PM
  2. Replies: 10
    Last Post: November 2nd, 10:32 AM
  3. change/swap order of two records in access
    By rey in forum ASP Database
    Replies: 2
    Last Post: November 9th, 12:14 AM
  4. Updating records in order (into an order)
    By A Ratcliffe in forum ASP Database
    Replies: 7
    Last Post: October 24th, 06:19 PM
  5. Sort Ascending numerically?
    By Steve Thomas in forum Microsoft Access
    Replies: 1
    Last Post: July 9th, 08:14 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139