1
script_fu
Sql text file layout

Im working on a three menu drop down box setup. Im haveing problems getting my test.txt which is a sql file to load properly.

The code comes from http://www.plus2net.com and im trying to modify
it to work for an XOOPS automotive parts request site.

What has me stumped is the year drop down I made in the test.txt file displays in a backwards manner. It should drop like this.

Year

2006
2005
2004
2003
2002

Instead it does it backwards.

1950
1951
1952
1953
1954

Am I loading the sql wrong?

http://www.mramerican.net/dd3.php
http://www.mramerican.net/test.txt
http://www.mramerican.net/dd3.zip

Thanks if you have the time...

Billy

2
Dave_L
Re: Sql text file layout
  • 2005/10/2 3:02

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


You can't make any assumptions about the order in which data is stored in the database. If you want to retrieve data in a certain order, you have to use an ORDER BY clause when you retrieve the data, e.g.

SELECT x,y,z FROM table ORDER BY z ASC

or

SELECT x,y,z FROM table ORDER BY x ASC, y DESC

Login

Who's Online

303 user(s) are online (195 user(s) are browsing Support Forums)


Members: 0


Guests: 303


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits