Records in Ascending Order

Ask a Question related to Macromedia Dreamweaver, Design and Development.

  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. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #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

Posting Permissions

  • You may not post new threads
  • You may 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