[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!)
================== - DW FAQs, Tutorials & Resources - DW FAQs, Tutorials & Resources

"David Powers" <[email protected]> wrote in message news:[email protected]
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)

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