9, January 2009

MYSQL ordered table - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ 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 98 times)
Bill Cosby is my Father
*
Posts: 4
40 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: 6557
40174 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 : Just a better Internet portal provided by Google
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8357
43129 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 Visit through proxy or twitter Visit through proxy

Last blog : Monetizing Old Posts
Nikolas' Servant Child
*
Posts: 31
190 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....

Topic sponsors:
Get a permanent link here for $1.99!


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?
Jan 09, 2009, 05:49:01 AM





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: 38.657
Total Topics: 7.772
Total Members: 4.659
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: sardiniasarena

16 Guests, 4 Users online :

16 users online today:



Readers

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