15, March 2010

MYSQL ordered table - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  Databases
Topic: MYSQL ordered table
« previous next »
Pages: [1] Print

Author Topic: MYSQL ordered table  (Read 832 times)
Total Zero
*
Posts: 5
50 credits
Members referred : 0


« on: Jan 06, 2009, 11:38:43 am »

Hello all,

I'd like to know if there is a way to insert into a MYSQL table data in an ordered way?
Right now as a workaround I've literally made a table of questions with questionID as primary key, nextQuestion and prevQuestion pointing to other questionIDs. Basically I've made a two way linked list from scratch. Is there anything built into MYSQL that implements this?

Thanks in advance.
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6690
34708 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Jan 06, 2009, 01:35:22 pm »

why do you need that? while selecting records you can set the order.

If it takes to much time you need to set an index on the column where the query is based on:

select * from table where field = 'something'

set an index to column 'field'


Last blog : A new Wordpress theme for our blog
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5659
45587 credits
Members referred : 3



« Reply #2 on: Jan 06, 2009, 03:44:13 pm »

Olaf is right. It doesn;t matter how you enter data in a database because you can retrieve them in any way you like.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
My Name is Enigo Montoya
*
Posts: 33
202 credits
Members referred : 0


« Reply #3 on: Jan 07, 2009, 11:32:16 am »

Olaf is right. It doesn;t matter how you enter data in a database because you can retrieve them in any way you like.

Yes. In particular, you can use the ORDER BY clause to specify the order:

Code:
select * from my_table ORDER BY question_id
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=8351
Tags : mysql table data ordered table data Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  Databases
Topic: MYSQL ordered table
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Mar 15, 2010, 08:34:07 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 44.163
Total Topics: 8.615
Total Members: 8.203
Tutorials : 58
Resources : 929
Designs : 360
Latest Member: scottm85

46 Guests, 4 Users online :

19 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2010 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.