Ordered lists

This is a discussion on Ordered lists within the MySQL Database forums, part of the Database Forums category; Hi, I need to store ordered lists in my database. I have several lists like 'I don't agree'=1, '...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-10-2007
BH
 
Posts: n/a
Default Ordered lists

Hi,

I need to store ordered lists in my database.
I have several lists like 'I don't agree'=1, 'I agree'=2, 'I totally
agree'=3
Quotes are not the same all times (letters could be used), that's why I
want to store thems, with the position because 'I agree' must be always
in the middle of the list.

How to do this with mysql ?

thanks.
Reply With Quote
  #2 (permalink)  
Old 09-10-2007
Gordon Burditt
 
Posts: n/a
Default Re: Ordered lists

>I need to store ordered lists in my database.

You need to use ORDER BY when you retrieve the data. SQL tables don't
have any order.

>I have several lists like 'I don't agree'=1, 'I agree'=2, 'I totally
>agree'=3
>Quotes are not the same all times (letters could be used), that's why I
>want to store thems, with the position because 'I agree' must be always
>in the middle of the list.


Record the choices along with the values, or if ordering by the
values doesn't always work (the values don't establish the correct
order), also have an "order" column whose sole function is to
establish the order.


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:18 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0