- Feb 19, 2001
- 408
- 0
- 0
Writing a CGI script that'll access my sqlplus database when I ask for a specific name. So I got it to work for the default table emp and I'm able to grab the info off of that table. But when I try to access my own table I get no love.
So I can get this part to work...
my $sth = $dbh->prepare("
select * from emp where upper(ENAME) = upper('$ename')
" );
$sth->execute()|| die "Oracle connection failed!";
while (my $search = $sth->fetchrow_hashref())
{
print "<TR>";
print "<TD>".$search->{EMPNO};
print "<TD>".$search->{ENAME};
print "<TD>".$search->{JOB};
print "<TD>".$search->{HIREDATE};
print "<TD>".$search->{SAL};
print "\n";
}
But when I change it up to this part it doesnt...
my $sth = $dbh->prepare("
select * from shelter where upper(sname) = upper('$sname')
" );
$sth->execute()|| die "Oracle connection failed!";
while (my $search = $sth->fetchrow_hashref())
{
print "<TR>";
print "<TD>".$search->{sname};
print "<TD>".$search->{city};
print "<TD>".$search->{pnumber};
print "\n";
}
I did a quick print at the top of my page to make sure that I'm passing the correct data and I have the right name's going through. Any suggestions? Thanks in advance..
So I can get this part to work...
my $sth = $dbh->prepare("
select * from emp where upper(ENAME) = upper('$ename')
" );
$sth->execute()|| die "Oracle connection failed!";
while (my $search = $sth->fetchrow_hashref())
{
print "<TR>";
print "<TD>".$search->{EMPNO};
print "<TD>".$search->{ENAME};
print "<TD>".$search->{JOB};
print "<TD>".$search->{HIREDATE};
print "<TD>".$search->{SAL};
print "\n";
}
But when I change it up to this part it doesnt...
my $sth = $dbh->prepare("
select * from shelter where upper(sname) = upper('$sname')
" );
$sth->execute()|| die "Oracle connection failed!";
while (my $search = $sth->fetchrow_hashref())
{
print "<TR>";
print "<TD>".$search->{sname};
print "<TD>".$search->{city};
print "<TD>".$search->{pnumber};
print "\n";
}
I did a quick print at the top of my page to make sure that I'm passing the correct data and I have the right name's going through. Any suggestions? Thanks in advance..