in reply to Re^2: Perl script to decode SQL ENCODE function
in thread Perl script to decode MySQL ENCODE() function
Could you give an actual code example, i'm not sure what you're saying. It appears from the MySQL documentation that the ENCODE function requires 2 parameters, but you haven't mentioned that. Anyway, likely the best way is to just connect to MySQL and perform the operation, for example:
use strict; use warnings; use DBI; my $dsn = 'DBI:mysql:host=localhost'; my $dbh = DBI->connect($dsn); my $sth = $dbh->prepare("SELECT DECODE('encodedcontent', 'secretvalue' +)"); $sth->execute; my $decoded = $sth->fetchrow; print $decoded;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Perl script to decode SQL ENCODE function
by Martin90 (Sexton) on Jul 22, 2013 at 20:14 UTC | |
by Loops (Curate) on Jul 22, 2013 at 20:36 UTC | |
by Martin90 (Sexton) on Jul 22, 2013 at 21:45 UTC |
In Section
Seekers of Perl Wisdom