HERE IS THE SOLUTION FOR PERL PROBLEM 5
#!usr/bin/perl -w
use DBI;
chomp($keyword=<>);
$dbh=DBI->connect("DBI:mysql:host=localhost;database=test","root","password");
$query="select * from table1 where keyword like '%$keyword%'";
$sth=$dbh->prepare($query);
$sth->execute();
while(@result=$sth->fetchrow_array()){
print "@result";
print "\n";
}
$dbh->disconnect();
Please post any doubts.
Thankyou
Teja
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment