🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #14276

perl en mysql vraagje

#14276
From: Franky Claeys
Date: Fri, 23 Mar 2001 16:17
67 lines
2362 bytes
hallo,


heb hier een probleempje met een perl/cgi scriptje. Hoe ik ook probeer, ik
krijg het maar niet aan de praat.
Ik krijg steeds de volgende foutboodschap:
use of uninitialized value at ticktest.pl line 29 (#1)
(w) An undefined value was used as if it were already defined. It was
interpreted as
a "" or as 0, but maybe it was a mistake. To suppress this warning assign an
initial value to your variable.

Ik ben nogal newbie en daardoor zie ik de fout dus niet echt staan in het
onderstaand script (alhoewel ik voel dat het misschien wel heel voor de hand
liggend is).
Ik gebruik perl en MySQL op een linux redhat 6.1.

bedankt alvast

Frank

www.franksite.net





#!/usr/bin/perl

use CGI;
use DBI;
use diagnostics;
use Data::Dumper;

$dbh = DBI->connect('dbi:mysql:test', 'root', 'anneleen');

$sql="SELECT * from ticklist";

$sth=$dbh->prepare($sql);
$sth->execute;
print <<"END";
Content-type:text/html\n\n

<html>
<head>
</head>
<body bgcolor="#FAEBD7">
END
while (@rows=$sth->fetchrow_array)
{
    print <<"END";
<p>testje</p>
END
for ($i=0; $i<=$#rows; $i++)
{
print "<h1>$rows[$i]</h1>"

}
print <<"END";
<p>test2</p>
END
}
print <<"END";
</body>
</html>
END
$dbh->disconnect;
Technical Details
Message-ID: <99fsr9$6np$1@mykenos.hogent.be>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!newsfeeds.belnet.be!naxos.belnet.be!news.belnet.be!mykenos.hogent.be!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: 107324,c92c20c634f97d57,start
X-Google-Attributes: gid107324,public
X-Google-Thread: fcea4,c92c20c634f97d57,start
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2001-03-23 08:21:01 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!bignews.mediaways.net!newsfeeds.belnet.be!naxos.belnet.be!news.belnet.be!mykenos.hogent.be!not-for-mail
From: "Franky Claeys" <franky.claeys@vt4.net>
Newsgroups: be.comp.programming,nl.comp.programmeren
Subject: perl en mysql vraagje
Date: Fri, 23 Mar 2001 17:17:35 +0100
Organization: Hogeschool Gent
Lines: 70
Sender: 963017fc@uu212-190-1-166.unknown.uunet.be
Message-ID: <99fsr9$6np$1@mykenos.hogent.be>
NNTP-Posting-Host: uu212-190-1-166.unknown.uunet.be
X-Trace: mykenos.hogent.be 985364137 6905 212.190.1.166 (23 Mar 2001 16:15:37 GMT)
X-Complaints-To: newsmaster@hogent.be
NNTP-Posting-Date: 23 Mar 2001 16:15:37 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400