Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
How to select mySQL question
Old 10-10-2007, 07:26 AM How to select mySQL question
Junior Talker

Posts: 1
Trades: 0
Hey there,

I got a question about how to select. My mysql database table has 3 different names in it and looks like this

id (int 11)
firstname (varchar 100)
username (varchar 100)
additional name (varchar 100)
display name (char 1)

now the user can select which name he/she want to show on the site. And that is saved in the display name which is a char --> f for firstname, u for username, a for additional name.

Now i want to select the name the user selected from the table ordered by that name as well, but how i do that?

select [selected_name] from members order by [selected_name] i am kinda lost..

greetings Martin
MLegend is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-10-2007, 09:15 AM Re: How to select mySQL question
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Point 1. You should NOT have spaces in a column name.

use a CASE statement as in (http://www.webmaster-talk.com/the-da...tml#post466198 )

Just use the column name in place of the text shown in the above example.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to How to select mySQL question
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10247 seconds with 12 queries