OK..Fine and Dandy.
But you've not responded to my request of editing my script to show me how to do them.
Here's my script again, kindly edit them:
#!/usr/bin/perl
require 'myconfigure.cgi';
$timeout = 5;
use DBI;
$keywords = "Whether rocking natural-curls, a-short";
print "Content-type: text/html\n\n";
sub do_search {
$time1 = time;
$dbh=DBI->connect("dbi:mysql:$database:localhost","$username","$pa
+ssword");
$keywords_quoted = $dbh ->quote ($keywords);
$query="SELECT count(*) FROM $websites_table WHERE MATCH(title) AG
+AINST ($keywords_quoted)";
$sth=$dbh->prepare(qq{$query});
$sth->execute();
$total_count = $sth->fetchrow_array ();
$sth->finish;
$dbh->disconnect ||die("Couldn't disconnect to database!\n");
$time2 = time;
$time_ran = $time2 - $time1;
}
eval {
local $SIG{ALRM} = sub { die "alarm\n" };
alarm $timeout;
&do_search;
alarm 0;
};
if($@) {
$time2 = time;
$time_ran = $time2 - $time1;
print "$@, Time Ran: $time_ran, Total Count: $total_count\n";
exit;
}
print "Time Ran: $time_ran, Total Count: $total_count\n";
exit;
|