On Fri, 23 Feb 2001 [EMAIL PROTECTED] wrote:

> I am sending a rather large UPDATE query to a table with a handful of sequential 
>fields (i.e. color1, color2, color3, size1, size2, size3, etc).  The query is 
>generated and executed from within a PHP script, and to make the script more 
>efficient, the query is generated with a FOR loop, so that instead of updating the 
>fields in the order in which they exist in the table, they are updated according to 
>their number at the end of the field name. 
> 
> So for example "UPDATE table SET color1='red', size1='big', color2='', size2='', 
>color3='', size3='' where id=1"
> 
> when i execute the query from the mysql shell, however, one row is matched but no 
>changes are made and warnings are returned.
> 
> My questions are:
> a) does it matter what order you attempt to update the fields in?

No.

> b) is there a way to view what the warnings were?

Yes. http://www.php.net/manual/en/function.mysql-error.php

Are you sure you're not appending an extra comma at the end  of your set
command? Also, it's helpful to output the sql statement you're about to
execute before you do.


Atle


---------------------------------------------------------------------
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