perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject Re: DBIx::Recordset and mySQL PASSWORD()
Date Thu, 22 Aug 2002 04:56:51 GMT
>How to insert into database something like INSERT INTO ... VALUES

>PASSWORD($rnd_pass)  ); ?

You need to prefix the field name with a \, then the value gets copied
literaly into the sql statmenet:

 *db = DBIx::Recordset -> Insert ({'!DataSource'    => $req->{db}->{dsn},
                                   '!Username'   => $req->{db}->{username},
                                   '!Password'   => $req->{db}->{password},
                                   '!Table'         => 'users',
                                   'uid'            => $regusername,
                                   'email'         => $regemail,
                                   '\passwd'      => "PASSWORD($rnd_pass)"
                                  }) ;

Gerald

P.S. Make sure $rnd_pass is checked correctly before, because it gets
literaly inserted in the SQL, so if any bad guy enters some SQL that you
don't expect, who knows what will happen...

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org



-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message