On Tue, 2004-07-06 at 08:33, [EMAIL PROTECTED] wrote:
> Hi everybody,
> 
> what I want to do is something like
> 
> $dbh->prepare('UPDATE table SET ? = ? WHERE id=?');
> $dbh->execute($column,$value, $id);
> 
> The encountered problem relates to the bind-process of $column.
> As I suppose I have to explicitly call the bind_param-method the tell the
> driver not to quote the column-name.

In general you can't use a placeholder for a column name (although some
drivers support it).

You should use something like:

$sth = $dbh->prepare("update table set $column = ? where id = ?");
$sth->execute($value, $id);

Michael
-- 
Michael Peppler                              Data Migrations, Inc.
[EMAIL PROTECTED]                       http://www.peppler.org/
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short
or long term contract positions - http://www.peppler.org/resume.html


Reply via email to