You are here: Re: Reverse mysql-result « PHP Programming Language « IT news, forums, messages
Re: Reverse mysql-result

Posted by Tony on 06/29/05 06:42

frizzle wrote:
> Wow thanks for all the replies!!!!
> I used Andy Hassall's way, and it works really good!
> There is a maximum of 10 results, so i don't
> expect any heavy calculations in this ...
>
> Now there is another thing i cant figure out:
> i need to update multiple rows, in 1 query.
>
> It has to have this effect:
>
> UPDATE pictures SET comment = 'this comment is really funny' WHERE id
> = '$id1' LIMIT 1
> UPDATE pictures SET comment = 'this comment is also funny' WHERE id =
> '$id2' LIMIT 1

Are you updating all of them to read the same?

UPDATE pictures SET comment='this comment is not funny' WHERE 1=1

Are you updating SOME of them to read the same?

UPDATE pictures SET comment='this comment is stupid' WHERE id='$id1' OR
id='$id2' OR id='$id3'...

Or, as it appears from above, you are updating them to read differently?

If the latter, then, sorry, but you'll have to run them one at a time.

> Somehow it keeps giving me an error.

( BTW - what gives you an error? )

--
Tony Garcia
Web Right! Development

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация