easy database table help!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
speedamp
Forum Commoner
Posts: 45
Joined: Tue Apr 29, 2003 3:59 pm

easy database table help!

Post by speedamp »

i have been looking all over the place, but i need to know how to create a field in my database table that simply adds two of the other fields?

what datatype.

i tried VARCHAR
length 5
values 'field_one'+'field_two'

what is the correct syntax?

-Michael
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post by lostboy »

alter table tablename add column columnname varchar(5)

update tablename set columnname = (col_1 + col_2)
Post Reply