Re: How to use DB functions while doing a create?
[prev]
[thread]
[next]
[Date index for 2005/01/11]
On Tue, Jan 11, 2005 at 11:14:59AM +0100, Daniel.Brunkhorst@xxxxxxxx.xx wrote:
> MySQL provides a function called "password" to store passwords encrypted
> in the DB. I was wondering how I could use that while using Class::DBI
> and its create method.
> Here's what I do now:
> my $dbh = MyClass->db_Main();
> $dbh->do( "INSERT INTO users VALUES ( $id, $name, password( '$pwd' ) "
> );
> Is there a way to better integrate this with Class::DBI?
Is it just during create() or during other calls?
You might be able to do something with setting the placeholder for the
column to 'PASSWORD(?)' rather than just '?'. But if you only need to
do it sometimes it gets much more complicated. Probably something nasy
involving subclasses the methods that need it and locally overriding
another method...
Tony
|
|
Re: How to use DB functions while doing a create?
Tony Bowden 10:21 on 11 Jan 2005
|