Ja to radim na ovaj nachin:
Code:
use DBI();
# koneckija
my $db=DBI->connect("DBI:mysql:database=baza;host=localhost","user","pass",{'RaiseError'=>1});
# primer upita
$upit = $db -> prepare("select NESTO from tabela");
$upit -> execute;
$r = $upit->fetchrow_hashref();
$primer_polja = $r->{'NESTO'};
# primer inserta
$ime = "Ivan";
$db->do("insert into tabela (NESTO) values (".$db->quote("$ime").")");
Ugrubo ;)
p.s.
Za ovo ti je potreban DBD-mysql modul, potrazi na cpan.perl.org
When you say "I wrote a program
that crashed Windows", people
just stare at
you blankly and say "Hey, I got
those with the system, *for
free*".
-- Linus Torvalds