Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > (Another) MySQL question

(Another) MySQL question
Thread Tools
Jaey
Mac Elite
Join Date: Dec 2003
Status: Offline
Reply With Quote
Feb 4, 2004, 08:45 PM
 
This might be simple.. or not.
Basically, I have a table with three columns.
The first column is 'INT NOT NULL AUTO_INCREMENT PRIMARY KEY'
The other two columns are both TEXT.

What's bothering me is that MySQL automatically orders the entries alphabetically by the text in the second column. I want it to order them using the numbers in the first column. How do I do this?

EDIT:
Um, I guess I was wrong. It's not doing that. I'm not sure what happened that one time...
( Last edited by Jaey; Feb 4, 2004 at 08:58 PM. )
     
philzilla
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Feb 4, 2004, 09:17 PM
 
let's say your 3 columns are id, foo, bar, then your query would be:

SELECT * FROM db_name ORDER BY id, foo, bar, ASC

try not to sue me if i've gotten the wrong end of the stick though, there's a good chap
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
Feb 5, 2004, 09:17 AM
 
Philz mate! What the hell are you doing posting at 1 AM on a wednesday night/thursday morning? Please tell me your not currently in the UK - cos if you are then that's some serious dedication to these boards and/or you're unemployed. Or is the times shown not GMT?

Oh wait - I get it. This is a ruse so you have an alibi for going and nicking cars yeah? "Sorry - but look I couldn't have nicked all those stereos, I was posting to this board at the time". I know your game

BTW - what part of liverpool are you from? My girlfriend is from near there, so I'm a wee bit curious. And please say you support Everton

<edit>Oh, you're a student, right? Because then it would make more sense </edit>
     
philzilla
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Feb 5, 2004, 09:54 AM
 
i'm usually up until about 4-5am, at the moment. working on something heavy. back up at 8am. ugh. neither student, nor unemployed, so you lose

currently residing on the Wirral, which doesn't mean i support Tranmere, before you say owt. i don't really follow footie at all. where's yer berd from?

thread - hijacked

// transmitted by philzAutoBot�
--EOT
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Arkham_c
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Feb 5, 2004, 10:28 AM
 
Originally posted by philzilla:
currently residing on the Wirral, which doesn't mean i support Tranmere, before you say owt. i don't really follow footie at all. where's yer berd from?
You might as well be speaking Chinese. Funny, I thought I spoke English. I'll have to get one of my UK friends to translate.

Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
Simon Mundy
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Feb 5, 2004, 10:41 AM
 
Originally posted by Arkham_c:
You might as well be speaking Chinese. Funny, I thought I spoke English. I'll have to get one of my UK friends to translate.

owt = anything
nowt = nothing

Tranmere = tranmere rovers (tee hee)

berd = lovely young lady (or similar!)

wirral = ... hang on, what the hell am I doing up at 1.45am...

Night
Computer thez nohhh...
     
philzilla
Occasionally Useful
Join Date: Jun 2001
Location: Liverpool, UK
Status: Offline
Reply With Quote
Feb 5, 2004, 11:31 AM
 
Originally posted by Simon Mundy:
owt = anything
nowt = nothing

Tranmere = tranmere rovers (tee hee)

berd = lovely young lady (or similar!)

wirral = ... hang on, what the hell am I doing up at 1.45am...

Night
simon, you have an almost perfect grasp of the English language. 10/10

home ya did yer homework before you went to bed
"Have sharp knives. Be creative. Cook to music" ~ maxelson
     
Chris O'Brien
Grizzled Veteran
Join Date: Nov 2003
Location: Hebburn, UK
Status: Offline
Reply With Quote
Feb 5, 2004, 12:32 PM
 
Ah - I take all the nicking car stuff back then if your living on the Wirral.

Me berd, well, she's actually from Bury, so not too near Liverpool at all really, just closer than most people I know - apart from my mate Dave, who is actually from the Wirral.

Less than four hours sleep a night? Ouch! Saying that - as a student, I quite often get only that, but for completely different reasons
     
   
 
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -4. The time now is 09:33 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,