You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
464 B
Perl

use DBI;
my $driver="DBI:mysql";
my $database="sample_db";
my $user="root";
my $password="";
my $host="localhost";
my $dbh = DBI->connect("$driver:$database:$host","$user","$password") or die "Can't connect: " . DBI->errstr;
$sth=$dbh->prepare("SELECT name FROM Employee where name LIKE ?") or die "Can't prepare sql statement" .
DBI->errstr;
$sth->bind_param(1, "Ch%");
$sth->execute();
$sth->dump_results();
$sth->finish();
$dbh->disconnect();