Return-Path: Delivered-To: apmail-perl-embperl-archive@perl.apache.org Received: (qmail 81436 invoked by uid 500); 22 Aug 2002 04:51:52 -0000 Mailing-List: contact embperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list embperl@perl.apache.org Received: (qmail 81423 invoked from network); 22 Aug 2002 04:51:52 -0000 Message-ID: <008c01c24998$54b88270$0b0c0b0a@gr.ecos.de> From: "Gerald Richter" To: "Jaak" , References: <200208212357.33102.variable@hot.ee> Subject: Re: DBIx::Recordset and mySQL PASSWORD() Date: Thu, 22 Aug 2002 06:56:51 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N >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