Hi Greg,

Basically, it was the same code, but I just added the type parameter to the bind_param call:

my $sql = "UPDATE m_user SET email = ?, first_name = ?, last_name = ? WHERE id = ?;";
            my $sth = $dbh->prepare($sql);
            $sth->bind_param(1, $get_vars->{new_email}, SQL_VARCHAR);
            $sth->bind_param(2, $get_vars->{userfirstname});
            $sth->bind_param(3, $get_vars->{userlastname});
            $sth->bind_param(4, $api_user_id);
            $sth->execute;
            $sth->finish;

Just out of curiosity, what would "$dbh->{pg_server_prepare} = 0" do?

Thanks,
Dave


On Nov 12, 2006, at 5:19 PM, Greg Sabino Mullane wrote:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Philip Garrett:
FWIW, I tested a simple "SELECT ?" with your '[EMAIL PROTECTED]'
value against my Postgres 7.2 (DBD::Pg 1.21).  It bound fine and
returned the correct value.

Yikes! Please update both of those right away - they are severely
old and unsupported. Might want to check DBI as well. :)

David Wu wrote:
Thanks for the suggestion.  I thought that might be the case as well,
and I've already tried adding the type attribute as a varchar, but
there was no change.

Can you show us the code you used to do so? You might also try this
variant and see if it helps:

$dbh->{pg_server_prepare} = 0;
my $sql = "UPDATE m_user SET email = ?, first_name = ?, last_name = ? WHERE id = ?";
my $sth = $dbh->prepare($sql);

- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200611122008
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFFV8ePvJuQZxSWSsgRArF8AJ94D9ytn1HhGQgq1PgvJ3JkoBjmVQCg6yJU
DJ9RMVFEKI8qw90z4YVwPkY=
=yXRj
-----END PGP SIGNATURE-----



Reply via email to