[Koha-cvs] CVS: koha/admin z3950servers.pl,1.8,1.8.2.1

MJ Ray slef at users.sourceforge.net
Tue Jan 6 19:57:26 CET 2004


Update of /cvsroot/koha/koha/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv4834/admin

Modified Files:
      Tag: rel_2_0
	z3950servers.pl 
Log Message:
DBI call fix for bug 662

Index: z3950servers.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/z3950servers.pl,v
retrieving revision 1.8
retrieving revision 1.8.2.1
diff -C2 -r1.8 -r1.8.2.1
*** z3950servers.pl	6 May 2003 14:55:41 -0000	1.8
--- z3950servers.pl	6 Jan 2004 18:57:24 -0000	1.8.2.1
***************
*** 36,58 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $query="Select host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers where (name like \"$data[0]\%\") order by rank,name";
! 	my $sth=$dbh->prepare($query);
! 	$sth->execute;
  	my @results;
- 	my $cnt=0;
  	while (my $data=$sth->fetchrow_hashref) {
  	    push(@results,$data);
- 	    $cnt ++;
  	}
  	#  $sth->execute;
  	$sth->finish;
  	$dbh->disconnect;
! 	return ($cnt,\@results);
  }
  
  my $input = new CGI;
  my $searchfield=$input->param('searchfield');
- my $reqsel="select host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers where (name = '$searchfield') order by rank,name";
- my $reqdel="delete from z3950servers where name='$searchfield'";
  my $offset=$input->param('offset');
  my $script_name="/cgi-bin/koha/admin/z3950servers.pl";
--- 36,53 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $sth=$dbh->prepare("Select host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers where (name like ?) order by rank,name");
! 	$sth->execute("$data[0]\%");
  	my @results;
  	while (my $data=$sth->fetchrow_hashref) {
  	    push(@results,$data);
  	}
  	#  $sth->execute;
  	$sth->finish;
  	$dbh->disconnect;
! 	return (scalar(@results),\@results);
  }
  
  my $input = new CGI;
  my $searchfield=$input->param('searchfield');
  my $offset=$input->param('offset');
  my $script_name="/cgi-bin/koha/admin/z3950servers.pl";
***************
*** 84,89 ****
  	if ($searchfield) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers where (name = '$searchfield') order by rank,name");
! 		$sth->execute;
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
--- 79,84 ----
  	if ($searchfield) {
  		my $dbh = C4::Context->dbh;
! 		my $sth=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers where (name = ?) order by rank,name");
! 		$sth->execute($searchfield);
  		$data=$sth->fetchrow_hashref;
  		$sth->finish;
***************
*** 139,144 ****
  	my $dbh = C4::Context->dbh;
  
! 	my $sth2=$dbh->prepare($reqsel);
! 	$sth2->execute;
  	my $data=$sth2->fetchrow_hashref;
  	$sth2->finish;
--- 134,139 ----
  	my $dbh = C4::Context->dbh;
  
! 	my $sth2=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax from z3950servers where (name = ?) order by rank,name");
! 	$sth2->execute($searchfield);
  	my $data=$sth2->fetchrow_hashref;
  	$sth2->finish;
***************
*** 158,163 ****
  	$template->param(delete_confirmed => 1);
  	my $dbh=C4::Context->dbh;
! 	my $sth=$dbh->prepare($reqdel);
! 	$sth->execute;
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED
--- 153,158 ----
  	$template->param(delete_confirmed => 1);
  	my $dbh=C4::Context->dbh;
! 	my $sth=$dbh->prepare("delete from z3950servers where name=?");
! 	$sth->execute($searchfield);
  	$sth->finish;
  													# END $OP eq DELETE_CONFIRMED





More information about the Koha-cvs mailing list