Total Zero
Posts: 5
50 credits Members referred : 0
« on: Jan 06, 2009, 10: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:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Jan 06, 2009, 12: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'
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 5799
46391 credits Members referred : 3
« Reply #2 on: Jan 06, 2009, 02: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.
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
Yes ORDER BY is the best option... you can order by ascending or descending...
What a dork
Posts: 17
102 credits Members referred : 0
« Reply #5 on: Jan 18, 2011, 05:32:03 pm »
the one thing you can do while creating the table itself no need to worry for the rest of the values
Sandwich Artist
Posts: 25
158 credits Members referred : 0
« Reply #6 on: Jan 27, 2011, 10:18:35 pm »
Would you say MYSQL is the best database format?
Where are my glasses?
Posts: 23
138 credits Members referred : 0
« Reply #7 on: Jan 31, 2011, 05:11:49 pm »
Quote from: ScottSchmidt
Would you say MYSQL is the best database format?
Well there is now a trend of moving away from relational databases; "NoSQL" so I'd keep my fingers crossed
My Name is Enigo Montoya
Posts: 32
192 credits Members referred : 0
« Reply #8 on: Mar 10, 2011, 08:20:27 pm »
I recently register new website and i am going to set up new data base. I don't know how to create this. Once i tried to do this. I enter in cpanel and then click on data base. After create new one with user name and password. After this i click on file manager but i am unable to do so.
Tell me what is problem. I am unable to login in my ftp account.
Hunky Junky Monky Man!
Posts: 60
408 credits Members referred : 0
« Reply #9 on: May 05, 2011, 06:04:23 pm »
MySql Database are one of the most appropriate database with lots of cool services involved in it. You can go ahead with the downloading the database adnd then later to upload the database as it is, some times it creates a huge directly in to yourwebsite which can take it if every things goes right . So do make sure you must have a perfect work on the database
Cyberpunk Wannabe
Posts: 41
300 credits Members referred : 0
« Reply #10 on: Oct 03, 2011, 11:10:44 am »
How about using a "priority" column so you can easily switch entries around and allow you to order the questions quickly within the SQL SELECT statement?
« Last Edit: Oct 03, 2011, 01:07:33 pm by Nikolas »
Chicken-run Manager
Posts: 9
60 credits Members referred : 0
« Reply #11 on: Apr 03, 2012, 03:53:44 pm »
It was too useful for me too. Thanks @troublescoot. However I would prefer mostly the Data Entity Framework and LinQ for database programming in ASP.NET. Although these was in the PHP.
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=8351