Perl mySql data to JSON file -
hello trying save mysql detail in json file how save mysql detail in json format ?
my perl code
#!/usr/bin/perl $file = $db->selectrow("select f.*, s.*, u.usr_login file_usr_login, u.usr_profit_mode (files f, servers s) left join users u on f.usr_id = u.usr_id f.file_code=? , f.srv_id=s.srv_id",$f->{id});
how save $file
detail in json ?
my $file = $db->selectrow( q[select f.*, s.*, u.usr_login file_usr_login, u.usr_profit_mode (files f, servers s) left join users u on f.usr_id = u.usr_id f.file_code=? , f.srv_id=s.srv_id], $f->{id} ); use json; $json = new json; $file_in_json = $json->encode($file);
Comments
Post a Comment