Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Just another Perl shrine
 
PerlMonks  

Re^5: Perl script to decode SQL ENCODE function

by Loops (Hermit)
on Jul 22, 2013 at 20:36 UTC ( #1045719=note: print w/ replies, xml ) Need Help??


in reply to Re^4: Perl script to decode SQL ENCODE function
in thread Perl script to decode MySQL ENCODE() function

Really can't say. Maybe a character encoding problem if you're copy-and-pasting. The following code works here:

use strict; use warnings; use DBI; my $db = DBI->connect('DBI:mysql:host=localhost'); my ($encoded) = $db->selectrow_array("SELECT ENCODE('ToBeHidden', 'sec +retvalue')"); my ($decoded) = $db->selectrow_array("SELECT DECODE('$encoded', 'secre +tvalue')"); print $decoded; # prints --> ToBeHidden


Comment on Re^5: Perl script to decode SQL ENCODE function
Download Code
Re^6: Perl script to decode SQL ENCODE function
by Martin90 (Acolyte) on Jul 22, 2013 at 21:45 UTC
    Yes, my mistake I copied binary string, shame ;) Thanks for help.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045719]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-04-17 05:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (440 votes), past polls