Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error message from running perl 1

Status
Not open for further replies.

windskystar73

Programmer
Jul 8, 2004
5
US
my $sth = $dbh->prepare("select email, fname from member where email = 'MY\@EMAIL.COM' ");
$sth->execute();


while (my $ref = $sth->fetchrow_hashref())
{
print "insert into mp_item_placement values ($ref->{'id'}, $ref->{'email'}, $ref->{'fname'} )\n";
}

when i run this simple perl program, i get this error message,
Use of uninitialized value in concatenation (.) or string.

it occurs at the line that just prints "id, email and fname". if i try without printing "id", it works, but only printing "id" causes a problem.

anybody knows why?


 
Your select statement does not request the column 'id' so the hash reference does not contain a key / value pair for the key id.

- Rieekan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top