Did you copy that query directly?  You're missing a quote to close value3.

Yitzchak Schaffer
Systems Librarian
Touro College Libraries
33 West 23rd Street
New York, NY 10010
Tel (212) 463-0400 x230
Fax (212) 627-3197
[EMAIL PROTECTED]


Tony Furnivall wrote:
Hi!

I'm having a problem with the UPDATE syntax for MySQL

(aside - I hate products that tell me I have a syntax problem, but don't tell me what it is - and then suggest that I go RTFM which is equally uninformative:-()

I'm replacing the entire set of fields, WHERE a condition exists for some of the fields, ie

UPDATE table_name SET field1 = ' value1', field2 = ' value2', field3 = ' value3, field4 = ' value4' WHERE field1 = ' value1' AND field2 = ' value2';

MySQL says that I have error 1064 'near WHERE field1 = ' value1' AND field2 = ' value2'

but it doesn't say what therror is (grrr!)

My questions:

My question is what is the appropriate way to expand the syntactic construct of "where_condition", which is not otherwise explained!

Help!

Tony


_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php

Reply via email to