List:General Discussion« Previous MessageNext Message »
From:David S. Jackson Date:January 25 2002 4:48pm
Subject:foreign key?
View as plain text  
Hi,

I'm trying to update the values of Contact_ID and
Volunteer_ID in a table called Contributors.  The layout for
Contributors is

+----------------+--------------+------+-----+---------+----------------+
| Field          | Type         | Null | Key | Default | Extra
|
+----------------+--------------+------+-----+---------+----------------+
| Contributor_ID | tinyint(3)   |      | PRI | 0       |
auto_increment |
| Name           | varchar(100) |      |     |         |
|
| Street_Address | varchar(50)  | YES  |     | NULL    |
|
| City           | varchar(20)  | YES  |     | NULL    |
|
| State          | varchar(5)   | YES  |     | NULL    |
|
| Zip            | mediumint(8) | YES  |     | NULL    |
|
| Contact_ID     | tinyint(3)   | YES  |     | NULL    |
|
| Volunteer_ID   | tinyint(3)   | YES  |     | NULL    |
|
+----------------+--------------+------+-----+---------+----------------+

I'm using the command:

 update Contributors set Contact_ID = "1", Volunteer_ID = '13'
 where Name = "Somebody Lastname";

After having issued the command, I get 

Query OK, 0 rows affected (0.00 sec)
Rows matched: 0  Changed: 0  Warnings: 0

But then when I select * in Contributors where Name = "Somebody
Lastname";	The values haven't been updated.  They remain 0
and 0.

What gives?  Is this a foreign key problem?

TIA.


PS.  Oh yeah, I'm using mysql 3.22 on debian 2.2.

-- 
David S. Jackson                        dsj@stripped
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The other day I... uh, no, that wasn't me.
		-- Steven Wright
Thread
foreign key?David S. Jackson25 Jan
  • Re: [ale] foreign key?Vaidhy Mayilrangam25 Jan
  • Re: foreign key?Gerald Clark25 Jan
  • Re: foreign key?DL Neil25 Jan
Re: foreign key?David S. Jackson25 Jan
RE: foreign key?Rick Emery25 Jan