Rutherdale, Will wrote:
That explains it. The purpose of placeholders is to let you specify
values, not column names. Your first form, without the placeholders, is
the correct way to do it.
I have a question: why do you even use variables for the column names?
Aren't the column names constant?
I'm creating a sub to update columns so i can reuse the code...
Thanks for the response.
-Gabriel
-Will
-----Original Message-----
From: Gabriel S. Oliveira [mailto:[EMAIL PROTECTED]
Sent: Friday 12 May 2006 11:42
To: [email protected]
Subject: Re:Bind Values Trouble
Let me explain better
I'm moving an entirely column to another in the same table
the variables
are the columns names:
$new_foo = "new_column";
$old_foo = "old_column";
When i use this statement everything is fine:
$dbh->do(qq{UPDATE foos SET $new_foo = $old_foo});
when i use i use placeholders like:
$dbh->do(qq{UPDATE foos SET $new_foo = ?}, undef, $old_foo);
i filled the "new_column" with zeros.
Best Regards,
--
Gabriel Sales de Oliveira | Async Open Source | [16] 3376 0125
- - - - - Appended by Scientific Atlanta, a Cisco company - - - - - This
e-mail and any attachments may contain information which is confidential,
proprietary, privileged or otherwise protected by law. The information is
solely intended for the named addressee (or a person responsible for delivering
it to the addressee). If you are not the intended recipient of this message,
you are not authorized to read, print, retain, copy or disseminate this message
or any part of it. If you have received this e-mail in error, please notify the
sender immediately by return e-mail and delete it from your computer.