On Wed, 12 Mar 2003, Jay G. Scott wrote:
> Greetings,
>
> My code follows. Should be enough for some bright person to figure
> out what I'm doing wrong. To me, it all looks fine.
>
>
> #!/usr/bin/perl
>
> use DBI;
> use Pg;
You don't need Pg methinks.
> use Getopt::Std;
>
> $DBSERVER="tor
]
Sent: Wednesday, March 12, 2003 4:16 PM
To: Jay G. Scott
Cc: [EMAIL PROTECTED]
Subject: Re: newbie can't see what he's doing wrong.
I suspect it's in the way you're setting up your query, but you didn't
show that part? Try this:
my $sql = 'SELECT m_id FROM machines
:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 4:16 PM
To: Jay G. Scott
Cc: [EMAIL PROTECTED]
Subject: Re: newbie can't see what he's doing wrong.
I suspect it's in the way you're setting up your query, but you didn't
show that part? Try this:
my $sql = 'SELECT m_i
I suspect it's in the way you're setting up your query, but you didn't
show that part? Try this:
my $sql = 'SELECT m_id FROM machines WHERE hostname = ?';
my $host = 'torn.arlut.utexas.edu';
my $sth = $dbh->prepare($sql);
$sth->execute($host);
while (my $m_id = $sth->fetchrow_array()) {
I tried it without the semicolon already, same thing happens.
(But I did try it again anyway.)
j.
--
Jay Scott 512-835-3553[EMAIL PROTECTED]
Head of Sun Support, Sr. Operating Systems Specialist
Applied Research Labs, Computer Science Div. S224
Univer
For one:
$command = "SELECT m_id FROM machines WHERE hostname = '$hostname';";
remove the ; within the sql string -- its not needed...
i.e. '$hostname'; <---
-Joe
--- "Jay G. Scott" <[EMAIL PROTECTED]> wrote:
>
> Greetings,
>
> My code follows. Should be enough for some bright person to fig
Greetings,
My code follows. Should be enough for some bright person to figure
out what I'm doing wrong. To me, it all looks fine.
#!/usr/bin/perl
use DBI;
use Pg;
use Getopt::Std;
$DBSERVER="torn.arlut.utexas.edu";
$USERNAME="postgres";
$PASSWORD="";
$dbh = DBI->connect("DBI:PgPP:database=t