Changeset 4545 for trunk/www


Ignore:
Timestamp:
Jan 8, 2004, 9:29:36 PM (20 years ago)
Author:
mij
Message:

Order by id. I'm not sure why I wasn't doing that to begin with.

Bug:
Submitted by:
Reviewed by:
Approved by:
Obtained from:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/includes/functions.inc

    r4121 r4545  
    11<?php
    22
    3 # $Id: functions.inc,v 1.2 2003/12/05 23:47:52 mij Exp $
     3# $Id: functions.inc,v 1.3 2004/01/08 21:29:36 mij Exp $
    44# Copyright (c) 2003, OpenDarwin
    55
     
    1919  global $DOCUMENT_ROOT, $connect;
    2020
    21   $query = "SELECT id, title, news FROM headlines ORDER BY timestamp DESC LIMIT 10";
     21  $query = "SELECT id, title, news FROM headlines ORDER BY id DESC LIMIT 10";
    2222  $result = mysql_query($query) or die("Error: $query.");
    2323  if(!$result) {
     
    7777  global $connect;
    7878
    79   $query = "SELECT id, DATE_FORMAT(timestamp, '%e %b %Y, %l:%i %p') AS f_timestamp, title, news FROM headlines ORDER BY timestamp DESC LIMIT 5";
     79  $query = "SELECT id, DATE_FORMAT(timestamp, '%e %b %Y, %l:%i %p') AS f_timestamp, title, news FROM headlines ORDER BY id DESC LIMIT 5";
    8080  $result = mysql_query($query) or die("Error: $query.");
    8181  if(!$result) {
     
    239239  echo "<p>Below is a list of all existing news headlines.  They can be viewed, edited, or deleted from this interface.  Alternatively, you can also <a href=\"add.php\">add news</a>.</p>\n\n";
    240240
    241   $query = "SELECT id, title, DATE_FORMAT(timestamp, '%e %b %Y, %l:%i %p') AS f_timestamp FROM headlines ORDER BY timestamp DESC";
     241  $query = "SELECT id, title, DATE_FORMAT(timestamp, '%e %b %Y, %l:%i %p') AS f_timestamp FROM headlines ORDER BY id DESC";
    242242  $result = mysql_query($query) or die("Error: $query.");
    243243  if(!$result) {
Note: See TracChangeset for help on using the changeset viewer.