Jump to content


Photo

reorganizing fields.


  • Please log in to reply
5 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 04 August 2006 - 05:20 PM

How do you reorganize fields in a table
I have 4 fields, and I want to make the 3rd field up to where the 1st is, it was my primary, I want my primary on top but have never had to change them around before.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 Wildbug

Wildbug
  • Members
  • PipPipPip
  • Advanced Member
  • 1,149 posts

Posted 04 August 2006 - 06:24 PM

I think that's under the ALTER TABLE syntax in the MySQL manual.  There's an option, FIRST|AFTER [COLUMN] that should allow you to switch things around.
Twice a day my clock works PERFECTLY!  I can't figure out what's wrong with it.

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 04 August 2006 - 06:32 PM

can you do it with php my admin also I will check into that for now thanks

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 04 August 2006 - 09:17 PM

I doubt that you can actually "move" columns without re-creating them and copying over the data.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#5 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 04 August 2006 - 11:06 PM

Is there any technical benefit to changing the order of the fields?  Why would anyone care "what's on top"?  Sounds like a disaster in the making to me.
Legend has it that reading the manual never killed anyone.
My site

#6 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 04 August 2006 - 11:19 PM

Agreed... which explains why there's no ability to do so.  Personally, I like the UID first, but who actually cares?  There is so little to be gained by a specific order that it's totally irrelevant.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users