List:General Discussion« Previous MessageNext Message »
From:bruce Date:October 14 2005 8:19pm
Subject:update row/tbl question...
View as plain text  
hi...

a basic/new/curious question. i have the following sample tbl schema. i do
the following update on the mysql command line and it updates for both
cases. my question is why???

it was my understanding that the two cases are different and shouldn't both
be triggered.the value of 'username' in the table is 'admin'.


DROP TABLE IF EXISTS UserTBL;
CREATE TABLE UserTBL (
  username varchar(20) NOT NULL default '',
  passwd varchar(60) NOT NULL default '',
  pwFlg int(2) NOT NULL default '',
  fname varchar(20) NOT NULL default '',
  lname varchar(20) NOT NULL default '',
  email varchar(50) NOT NULL default '',
  `usertype` varchar(25) NOT NULL default '',
`gid` tinyint(3) unsigned NOT NULL default '1',
  home_phone varchar(20) NOT NULL default '',
  company_phone varchar(20) NOT NULL default '',
  cell_phone varchar(20) NOT NULL default '',
  address1 varchar(20) NOT NULL default '',
  address2 varchar(20) NOT NULL default '',
  city varchar(20) NOT NULL default '',
  state varchar(20) NOT NULL default '',
  countryID varchar(20) NOT NULL default '',
  `active` enum('y','n') NOT NULL default 'n',
  enable int(1) NOT NULL default '',
  LoginStartTime   timestamp NOT NULL default '',
  LoginLimit   int NOT NULL default '',
  usergroup varchar(10) NOT NULL default '',
  userlevel varchar(10) NOT NULL default '',
  tmp_mail varchar(50) NOT NULL default '',
  `real_name` varchar(32) NOT NULL default '',
  `extra_info` varchar(100) NOT NULL default '',
  `access_level` tinyint(4) NOT NULL default '0',
`registerDate` datetime NOT NULL default '0000-00-00 00:00:00',
`lastvisitDate` datetime NOT NULL default '0000-00-00 00:00:00',
  ID int(5) NOT NULL auto_increment,
  UNIQUE KEY ID (ID),
  unique (username),
  KEY `usertype` (`usertype`)
) TYPE=MyISAM DEFAULT CHARSET=latin1;


update UserTBL set gid='25', usertype='Super Administrator11' where
username='ADmin';
update UserTBL set gid='25', usertype='Super Administrator11' where
username='admin';

'username' = 'admin' in the tabls...

thanks

-bruce

bedouglas@stripped


Thread
update row/tbl question...bruce14 Oct
  • Re: update row/tbl question...Dan Nelson14 Oct