Jump to content

Archived

This topic is now archived and is closed to further replies.

fert

How do you create a new varible?

Recommended Posts

I don't understand. Do you mean a @variable? or perhaps a field? (alter table...)

Share this post


Link to post
Share on other sites
[quote author=effigy link=topic=111616.msg452609#msg452609 date=1161008578]
a field? (alter table...)
[/quote]
I mean a field

Share this post


Link to post
Share on other sites
ALTER TABLE `YOUR_TABLE_NAME` ADD `YOUR_FIELD_NAME` YOUR_FEILD_TYPE NOT NULL ;

a field type is like text (TEXT) or integer (INT).

more field types
http://dev.mysql.com/doc/refman/4.1/en/data-types.html

if you want just a normal string variable like a 'username' and your table is named 'table1' your query might look like:

ALTER TABLE `table1` ADD `username` TEXT NOT NULL 

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.