Jump to content


Photo

adding a column to an existing table


  • Please log in to reply
2 replies to this topic

#1 Fyorl

Fyorl
  • Members
  • PipPipPip
  • Advanced Member
  • 273 posts
  • LocationUK

Posted 26 September 2003 - 05:48 AM

Is it possible to add a column to a table you\'ve already created? I\'ve got quite a big table with all the player stats on and I while I was creating it I forgot to add a hp column. Is there any way I can do this without, changing the name of the table and creating a new one? Because I don\'t want to then search through all my code, changing every instance where the old table name appeared. Also, if I add a column, will rows get added to it?
[table]



Don't worry, the printer fairies will sort it out.

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 26 September 2003 - 06:26 AM

Try this

ALTER TABLE <table_name> add column (hp varchar(100))

Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#3 Fyorl

Fyorl
  • Members
  • PipPipPip
  • Advanced Member
  • 273 posts
  • LocationUK

Posted 26 September 2003 - 04:06 PM

danke
[table]



Don't worry, the printer fairies will sort it out.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users