Skip to content
Permalink
Browse files

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:

git-svn-id: https://svn.macports.org/repository/macports/trunk/www@4545 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
Jim Mock
Jim Mock committed Jan 8, 2004
1 parent d6b8f23 commit 82f116291544aa3f489474fe2e647e2930f5b1d1
Showing with 4 additions and 4 deletions.
  1. +4 −4 includes/functions.inc
@@ -1,6 +1,6 @@
<?php

# $Id: functions.inc,v 1.2 2003/12/05 23:47:52 mij Exp $
# $Id: functions.inc,v 1.3 2004/01/08 21:29:36 mij Exp $
# Copyright (c) 2003, OpenDarwin

######################################################################
@@ -18,7 +18,7 @@ mysql_select_db($db);
function create_rss() {
global $DOCUMENT_ROOT, $connect;

$query = "SELECT id, title, news FROM headlines ORDER BY timestamp DESC LIMIT 10";
$query = "SELECT id, title, news FROM headlines ORDER BY id DESC LIMIT 10";
$result = mysql_query($query) or die("Error: $query.");
if(!$result) {
die("Error: $result.");
@@ -76,7 +76,7 @@ function create_rss() {
function print_headlines() {
global $connect;

$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";
$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";
$result = mysql_query($query) or die("Error: $query.");
if(!$result) {
die("Error: $result.");
@@ -238,7 +238,7 @@ function print_all_headlines() {

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";

$query = "SELECT id, title, DATE_FORMAT(timestamp, '%e %b %Y, %l:%i %p') AS f_timestamp FROM headlines ORDER BY timestamp DESC";
$query = "SELECT id, title, DATE_FORMAT(timestamp, '%e %b %Y, %l:%i %p') AS f_timestamp FROM headlines ORDER BY id DESC";
$result = mysql_query($query) or die("Error: $query.");
if(!$result) {
die("Error: $result.");

0 comments on commit 82f1162

Please sign in to comment.
You can’t perform that action at this time.