SHARE
TWEET

Untitled

a guest Jun 5th, 2017 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/perl -w
  2. use CGI qw(:standard);
  3. use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
  4. use strict;
  5.  
  6. my $SQLdatabase = "database_name_goes_here";
  7. my $SQLusername = "username_goes_here";
  8. my $SQLpassword = "password_goes_here";
  9.  
  10. my $SQLcommand = "enter_your_command_here";
  11.  
  12. open SQL, "mysql -u $SQLusername --password=\"$SQLpassword\" -t -e \"use $SQLdatabase; $SQLcommand\" |";
  13.  
  14. print header;
  15. print start_html("Test SQL commands");
  16. print "<pre>";
  17. while ( defined( my $line = <SQL> ) ) { print "$line";}
  18. print "</pre>";
  19. print end_html;
  20. close SQL;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top