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.

PHP Forum


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



Freelance Jobs

Reply
Old 12-25-2007, 03:59 PM Is This Possible
evans123's Avatar
Ultra Talker

Posts: 468
Trades: 0
Basically i have an array with $array = array("DFL", "CBK", "DFR"); and i have a while function i want to be able to in my mysql query select the position in the order of the array. Is it possible.
evans123 is offline
Reply With Quote
View Public Profile Visit evans123's homepage!
 
 
Register now for full access!
Old 12-25-2007, 04:17 PM Re: Is This Possible
InfinitySchima's Avatar
Skilled Talker

Posts: 71
Name: Rafael Schimassek
Trades: 0
So if i'm understanding it right you want to create a MySQL SELECT Query which sorts the result in a "unlogical" way..
Hmm, as far as I now this isn't possible, because you are not following any logic. What I would suggest in here is that you SELECT the data in any order, and then store them in 'acossiative' array ($array['textinhere']). And when showing the data in your specific order you do it manually.
Or you could also create a column in the table where you input the order of them in numbers and then: "SELECT * FROM my_table ORDER BY my_order ASC" (like the first one being a row with the my_order field = 1).

Whenever you want to create your own order there is not much help than to do it manually.
InfinitySchima is offline
Reply With Quote
View Public Profile
 
Old 12-25-2007, 10:42 PM Re: Is This Possible
Banned

Posts: 7
Trades: 0
yes, use implode fuction

< link drop removed >

Last edited by chrishirst; 12-26-2007 at 03:15 PM..
sukosari is offline
Reply With Quote
View Public Profile
 
Old 12-26-2007, 05:57 AM Re: Is This Possible
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
If I understand you right, because even my cat speaks better English, you will have to add a field into your mysql table to store the order of your elements and order by that field when doind select. There is no another obvious way to do what you want.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 12-26-2007, 05:59 AM Re: Is This Possible
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Oh well, Infinity already told you that.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Reply     « Reply to Is This Possible
 

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.33470 seconds with 12 queries