diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2016-01-08 18:17:14 +0100 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2016-01-08 18:17:14 +0100 |
| commit | ab265f85673b2eaa1f9de108ad962dba602b71de (patch) | |
| tree | 43eba38ef45c8cc194b6b181cb95f34cdd4b82df /Aufgabe7/db-passwd-read-table.pl | |
| parent | 853dfabf5172b66316849b8ef4fe92b9933677ad (diff) | |
| download | Skriptsprachen-master.tar.gz Skriptsprachen-master.zip | |
Diffstat (limited to 'Aufgabe7/db-passwd-read-table.pl')
| -rw-r--r-- | Aufgabe7/db-passwd-read-table.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Aufgabe7/db-passwd-read-table.pl b/Aufgabe7/db-passwd-read-table.pl index 8e06a80..e7290b8 100644 --- a/Aufgabe7/db-passwd-read-table.pl +++ b/Aufgabe7/db-passwd-read-table.pl @@ -28,9 +28,9 @@ use DBI; # Get database config my %dbconf = do 'dbinc.pl'; -my $dbhandle = DBI->connect("DBI:mysql:host=$dbconf{dbhost};database=$dbconf{dbdatabase}", $dbconf{dbuser}, $dbconf{dbpasswd}) or die 'DB not accessible'; +my $dbhandle = DBI->connect("DBI:mysql:host=$dbconf{dbhost};database=$dbconf{dbdatabase}", $dbconf{dbuser}, $dbconf{dbpasswd}, {RaiseError=>1}) or die 'DB not accessible'; -my $passwdArray = $dbhandle->selectall_arrayref("SELECT * FROM stsuh_passwort"); +my $passwdArray = $dbhandle->selectall_arrayref("SELECT * FROM stsuh_passwort") or die $dbhandle->errstr; printf ("%-4s | %-13s | %-8s | %-6s | %-6s | %-35s | %-25s | %-20s\n", "nr", "loginname", "password", "uid", "gid", "comment", "homedir", "commandinterpreter"); printf ('%1$s'x140 . "\n", "-"); |
