Jump to content


Photo

How do you create a new varible?


  • Please log in to reply
3 replies to this topic

#1 fert

fert
  • Members
  • PipPipPip
  • Advanced Member
  • 1,114 posts

Posted 16 October 2006 - 05:13 AM

How do you create a new varible in an existing row?

Si hoc legere scis nimium eruditionis habes
Gentoo Linux 2007.0 Firefox 2

#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 16 October 2006 - 02:22 PM

I don't understand. Do you mean a @variable? or perhaps a field? (alter table...)
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 fert

fert
  • Members
  • PipPipPip
  • Advanced Member
  • 1,114 posts

Posted 16 October 2006 - 04:49 PM

a field? (alter table...)

I mean a field

Si hoc legere scis nimium eruditionis habes
Gentoo Linux 2007.0 Firefox 2

#4 a2bardeals

a2bardeals
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts
  • LocationAnn Arbor, MI

Posted 17 October 2006 - 12:21 AM

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...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 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users