R
Robert Nilsson
Hi there
Does anyone here know how I should load a display from a Oracle database and
display it? I'm working on a DVD database over my own DVD's and I'd like to
show a picture together with each title.
Right now; I only got the text fields. It's like this:
--------------------------------------------------------------------------
#!/usr/bin/perl -w
use CGI ':standard';
use DBI;
$ENV{"ORACLE_HOME"} = "/opt/oracle/product/9.0.1";
$vendor = "Oracle";
$host =;
$sid = ;
$user =;
$pw =";
$dbh = DBI->connect("dbi:$vendor:host=$host;sid=$sid", $user, $pw);
$select = $dbh->prepare("select title, director, genre, length, starring
from dvd where hidden is null order by title");
$select->execute;
print header;
print start_html('-title' => 'DVD Movies',
'-bgcolor' => 'white');
print "<table border=2 bgcolor=FFFCC>";
print TR( td("Title"), td("Director"), td("Genre"), td("Length"),
td("Starring") );
while (@dvd = $select->fetchrow()) {
print TR( td($dvd[0]), td($dvd[1]), td($dvd[2]), td($dvd[3]),
td($dvd[4])),"\n";
}
print "</table>";
print end_html;
Does anyone here know how I should load a display from a Oracle database and
display it? I'm working on a DVD database over my own DVD's and I'd like to
show a picture together with each title.
Right now; I only got the text fields. It's like this:
--------------------------------------------------------------------------
#!/usr/bin/perl -w
use CGI ':standard';
use DBI;
$ENV{"ORACLE_HOME"} = "/opt/oracle/product/9.0.1";
$vendor = "Oracle";
$host =;
$sid = ;
$user =;
$pw =";
$dbh = DBI->connect("dbi:$vendor:host=$host;sid=$sid", $user, $pw);
$select = $dbh->prepare("select title, director, genre, length, starring
from dvd where hidden is null order by title");
$select->execute;
print header;
print start_html('-title' => 'DVD Movies',
'-bgcolor' => 'white');
print "<table border=2 bgcolor=FFFCC>";
print TR( td("Title"), td("Director"), td("Genre"), td("Length"),
td("Starring") );
while (@dvd = $select->fetchrow()) {
print TR( td($dvd[0]), td($dvd[1]), td($dvd[2]), td($dvd[3]),
td($dvd[4])),"\n";
}
print "</table>";
print end_html;