fork download
  1. #!/usr/bin/perl
  2. #Settings.constants érték lekérdezés
  3. #!/usr/bin/perl -w
  4.  
  5. package getConst;
  6.  
  7. sub getConst
  8. {
  9. my $key = $_[0];
  10. my $fallBack;
  11. if($_[1] ne "")
  12. {
  13. $fallBack = $_[1];
  14. }
  15. else
  16. {
  17. $fallBack = "";
  18. }
  19.  
  20. my $res = $dbh->prepare("SELECT value FROM settings.constants WHERE name = '" . $key . "' LIMIT 1;");
  21. $res->execute();
  22.  
  23. my $returnResult = $res->fetchrow_hashref;
  24.  
  25. if($returnResult->{'value'})
  26. {
  27. return $returnResult->{'value'};
  28. }
  29. else
  30. {
  31. return $fallBack;
  32. }
  33. }
  34.  
  35.  
  36.  
  37. 1;
Success #stdin #stdout 0s 18256KB
stdin
Standard input is empty
stdout
Standard output is empty