insert into table
Moderator: General Moderators
-
vblifeline
- Forum Newbie
- Posts: 7
- Joined: Fri Jan 23, 2004 4:13 pm
insert into table
lets say i had a table
1-jason
2-jessica
3-cerise
and i wanted to insert jeff into it like so
1-jason
2-jeff
3-jessica
4-cerise
how would i go about doing this
1-jason
2-jessica
3-cerise
and i wanted to insert jeff into it like so
1-jason
2-jeff
3-jessica
4-cerise
how would i go about doing this
-
vblifeline
- Forum Newbie
- Posts: 7
- Joined: Fri Jan 23, 2004 4:13 pm
a already have mysql setup and every thin and the data bases in there i want to insert data into the middle of the table becuase i have it setup all nice and pretty and in ordor i just wanted to know if there was a way of saying like "inset into table values('$name','$birth','$adress') where index = blah" does that work i dont think so but something like that i was woundering
That's a database design question, really, and it depends entirely on what you're really trying to do. For instance, is it really important that the data be in the database in that order, or do you just need it to display that way when you output it? What are the fields in your database? Is this the sort of thing you'll need to do frequently, or not?
-
vblifeline
- Forum Newbie
- Posts: 7
- Joined: Fri Jan 23, 2004 4:13 pm
-
vblifeline
- Forum Newbie
- Posts: 7
- Joined: Fri Jan 23, 2004 4:13 pm
-
vblifeline
- Forum Newbie
- Posts: 7
- Joined: Fri Jan 23, 2004 4:13 pm
-
vblifeline
- Forum Newbie
- Posts: 7
- Joined: Fri Jan 23, 2004 4:13 pm
-
microthick
- Forum Regular
- Posts: 543
- Joined: Wed Sep 24, 2003 2:15 pm
- Location: Vancouver, BC
If you aren't sorting the records in a natural way (ordered by id ascendingly or descendingly, or by name alphabetically) you need to introduce your own scheme for doing so.
What I've done before is create another column called Sequence. And Sequence contains an integer which represents the order that you want it to appear in.
It's a bit of work to program, since if you insert one in the middle, you have to move each of the other items down one. Etc.
What I've done before is create another column called Sequence. And Sequence contains an integer which represents the order that you want it to appear in.
It's a bit of work to program, since if you insert one in the middle, you have to move each of the other items down one. Etc.