The code is:install_driver(Pg) failed: Can't load '/usr/lib/perl5/vendor_perl/5.8. +0/i386-linux-thread-multi/auto/DBD/Pg/Pg.so' for module DBD::Pg: libp +q.so.2: cannot open shared object file: No such file or directory at +/usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 229. at (eval 7)[/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/ +DBI.pm:597] line 3 Compilation failed in require at (eval 7)[/usr/lib/perl5/vendor_perl/5 +.8.0/i386-linux-thread-multi/DBI.pm:597] line 3. Perhaps a required shared library or dll isn't installed where expecte +d at dbusers line 6 DBI::install_driver('DBI','Pg') called at /usr/lib/perl5/vendo +r_perl/5.8.0/i386-linux-thread-multi/DBI.pm line 497 DBI::connect('DBI','DBI:Pg:dbname=shop1','','') called at dbus +ers line 6
~ I am very new to this any help will be greatly appreciated. Lewie#!/usr/bin/perl -w use strict; use DBI; # Connect to the database my $dbh = DBI->connect('DBI:Pg:dbname=shop1', '', '') or die "Couldn't open database: '$DBI::errstr'; <br>stopped"; $dbh->do("CREATE TABLE users (uid INT, login CHAR(8))"); $dbh->disconnect;
Edited by Chady -- added code tags.
In reply to using DBI to connect to postgres by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |