Page 1 of 1

Possible to add same data to ALL tables?

Posted: Fri Aug 24, 2007 12:32 pm
by thefreebielife
Here is my table structure:

Code: Select all

  `uId` int(6) NOT NULL auto_increment,
  `username` text NOT NULL,
  `password` text NOT NULL,
  `fname` text NOT NULL,
  `phone` text NOT NULL,
  `email` text NOT NULL,
  `address` text NOT NULL,
  `city` text NOT NULL,
  `state` text NOT NULL,
  `zip` text NOT NULL,
  `country` text NOT NULL,
  `ip` text NOT NULL,
  `gid` int(6) NOT NULL default '0',
  `rid` int(6) NOT NULL default '0',
  `ostatus` double NOT NULL default '0',
  `holdreason` text NOT NULL,
  `astatus` tinyint(4) NOT NULL default '0',
  `date` text NOT NULL,
  `deadline` text NOT NULL,
  `dead` tinyint(4) NOT NULL default '0',
  `istatus` tinyint(4) NOT NULL default '0',
  `denyreason` text NOT NULL,
  `rollo` int(6) NOT NULL default '0',
  `site` varchar(10) NOT NULL default 'Cash',
  PRIMARY KEY  (`uId`)
) ENGINE=MyISAM AUTO_INCREMENT=72104 DEFAULT CHARSET=latin1 AUTO_INCREMENT=72104 ;
Is it possible to get all the current tables to have "site" as "Cash"?

If so, how?

Thanks,
Jared

Posted: Fri Aug 24, 2007 12:55 pm
by VladSun
All tables? I do see only one ...

Code: Select all

update `table` set `site`="Cash"

Posted: Fri Aug 24, 2007 5:10 pm
by califdon
Let me guess: did you mean to say "all records in the table"? The Default parameter for a field in a table is only effective for NEW records added. What do you want to do? Are there records in the table already? What values, if any, are in the "site" field? Do you want to replace them? All of them? If so, that's what VladSun showed you how to do.