macromedia.dreamweaver.appdev
[Top] [All Lists]

Re: Multiple updates sequentially?

Subject: Re: Multiple updates sequentially?
From: "Murray *ACE*"
Date: Thu, 1 May 2008 13:36:32 -0400
Newsgroups: macromedia.dreamweaver.appdev


Elegant.  Thank you!

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"David Powers" <david@xxxxxxxxxxx> wrote in message news:fvcuvg$mvm$1@xxxxxxxxxxxxxxxxxxxxxxxx
Murray *ACE* wrote:
$query = "UPDATE table ";
$query .= $a?"SET fieldname=value,":'';
$query .= $b?"SET fieldname2=value2,":'';
$query .= $c?"SET fieldname3=value3":'';

$query = 'UPDATE table SET ';
if ($a) $set[] = 'fieldname = value';
if ($b) $set[] = 'fieldname = value';
if ($c) $set[] = 'fieldname = value';
$query .= implode(', ', $set);

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/


<Prev in Thread] Current Thread [Next in Thread>