[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 02-14-2006, 06:26 AM   #1 (permalink)
Account Suspended
 
Domains4u's Avatar
 
Join Date: Nov 2005
Location: www.TFFH.net
Posts: 280
58.80 NP$ (Donate)

Domains4u has a spectacular aura aboutDomains4u has a spectacular aura about


MySQL Query Help

Hi there.

Ive got a databse running and an admin panel so i can add data. The data is displayed in a table.

When i add new data the new data ends up at the bottom of the post. Check www.UKGMC.com for an example.

Heres the code im using. How would i change it to display the newest data at the top?

Code:
$query = "SELECT CONCAT(dl_genre) AS genre, (dl_name) AS name, (dl_desc) AS dr, (dl_date) AS cat, (dl_link) AS link 
FROM dl ORDER BY dl_id ASC"; 
$result = @mysql_query ($query);
Domains4u is offline  
Old 02-14-2006, 07:07 AM   #2 (permalink)
NamePros Regular
 
moondog's Avatar
 
Join Date: Jun 2004
Posts: 476
3,677.00 NP$ (Donate)

moondog is a glorious beacon of lightmoondog is a glorious beacon of lightmoondog is a glorious beacon of lightmoondog is a glorious beacon of lightmoondog is a glorious beacon of lightmoondog is a glorious beacon of light


try:

PHP Code:
$query = "SELECT CONCAT(dl_genre) AS genre, (dl_name) AS name, (dl_desc) AS dr, (dl_date) AS cat, (dl_link) AS link
FROM dl ORDER BY dl_id DESC"
;
__________________
The mass purge has begun.
moondog is offline  
Old 02-14-2006, 07:31 AM   #3 (permalink)
Account Closed
 
Join Date: Feb 2006
Posts: 42
0.00 NP$ (Donate)

imMike is an unknown quantity at this point


What he said. Change ASC (ascending order) to DESC (descending order) in your query.
imMike is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Great Scripts for Sale With Resale Rights! Zeeble Scripts For Sale 20 01-04-2006 01:39 AM
MySQL Tips shahid_146 Webmaster Tutorials 4 10-18-2005 12:53 PM
Tutorial: How to Install Apache2 MySQL and PHP on Windows deadserious Webmaster Tutorials 35 09-21-2005 09:46 PM
Tutorial: Getting Started With MySQL (The Basics) deadserious Webmaster Tutorials 3 04-18-2004 01:17 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 12:46 PM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

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