Thanks for your input!

It is fixed now, by using the , instead of an and however, the thing that
threw me was that it didn't complain about it!

Thanks Again.

Richard


-----Original Message-----
From: Chris Johnson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 5:10 PM
To: Salada, Duncan; 'Richard Morton'; MySQL List
Subject: Re: Update


I'd have to guess that MySQL is interpreting the "set" clause this way:

Set events_ID = ( 512 AND ( term = 'changed' ))

That is, a logical AND, so a zero result makes sense.  Still, it seems a bit
odd.


----- Original Message -----
From: "Salada, Duncan" <[EMAIL PROTECTED]>


For one of two reasons (probably) - and I think you found a bug:

1.  The syntax in your "set" clause is wrong.  It should be "set
alternatepreference='C',AltContactID='1'"  *Notice the use of a comma
instead of "and"*

2.  The row that matched the conditions in the "where" clause may already be
set to those values.  MySQL will not update a row needlessly.

I tried out your syntax on MySQL 3.23.47 (i.e. using "and" in the "set"
clause) and got some unexpected results.  Below is a synopsis of what
happened when I ran a query with the "and" syntax on my machine.

THE FIRST TIME
update events_terms set events_ID=512 and term='changed' where ID=108;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

It says a row was changed and it was -- but not correctly!  The events_ID
column was set to 0 and the term column was not changed at all.  That
doesn't seem like the correct behavior.  Then executed the query again...





---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to