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
speedamp
Forum Commoner
Posts: 45 Joined: Tue Apr 29, 2003 3:59 pm
Post
by speedamp » Fri May 14, 2004 3:15 pm
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 » Fri May 14, 2004 3:20 pm
alter table tablename add column columnname varchar(5)
update tablename set columnname = (col_1 + col_2)