View stunning SlideShares in full-screen with the new iOS app!Introducing SlideShare for AndroidExplore all your favorite topics in the SlideShare appGet the SlideShare app to Save for Later — even offline
View stunning SlideShares in full-screen with the new Android app!View stunning SlideShares in full-screen with the new iOS app!
my $hostname = "dbm1.itc.virginia.edu"; my $username = "dld5s"; # "my" defines a local variable my $password = “…"; # fill in my $database = $username . "_study"; # = dld5s_study my $data_source = "DBI:mysql:$database:$hostname";
Connect to the database:
my $dbh = DBI->connect($data_source, $username, $password) or die "Can't connect to $data_source: $DBI::errstr
my $SQL = "SELECT FirstName, LastName, DOB, Gender FROM Patients WHERE Gender = '$Gender' ORDER BY FirstName DESC"; my $sth = $dbh->prepare($SQL) or die "Unable to prepare $SQL: dbh->errstr
"; $sth->execute or die "Unable to execute query: $dbh->errstr