#!/usr/bin/perl -w # --------------------------------------------------- # # ask23-swk-db.pl v0.1 | 2005-02-02 # --------------------------------------------------- # teil des ask23-swk pakets | http://draft.ask23.de # script zum manipulieren des schlagwort-zählers in mysql-datenbank "swk-n" # --------------------------------------------------- # --------------------------------------------------- # v0.1 # todo: schnittstelle zu oder aufruf von ask23-suche/ask23-indexer.pl (ggf. als .pm) # korrekter sql-befehl use strict; use DBI; my $dbpath = "dbi:mysql:database=swk-n;host=localhost"; my $dbh = DBI->connect($dbpath, "{account_name}", "{password}") or die "Can't open database: $DBI::errstr"; my $counter = 1; #[-------hier wird der parameter "counter" definiert, später aus indexer übernommen! my $schlagwort = ""; $query = "INSERT INTO schlagwort (counter) VALUES ('$counter')"; #[---------------------------here $counter ist übergegebenen parameter value] #### wo wird die zuordnung zu einem schlagwort definiert? $sth = $dbh->prepare($query); $sth->execute(); print "Record inserted into the database"; # optional $sth->finish(); # disconnect from databse $dbh->disconnect;