



|
|
Category
Page
[-
use DBI ;
# connect to database
$dbh = DBI->connect('dbi:Pg:dbname=country','postgres', '');
# prepare the sql select
$sth = $dbh->prepare ("select catsu from category where catca<>'Computers'");
# excute the query
$sth -> execute ;
# get the result in $dat
$prosu = $sth -> fetchall_arrayref ;
#$sub = [+$prosu -> [$row][$col]+];
#Special 1
$sth = $dbh->prepare ("select prona from products where proid = 'DS10'");
$sth->execute;
$name = $sth -> fetchall_arrayref ;
$sth = $dbh->prepare ("select prosa from products where proid ='DS10'");
$sth->execute;
$cost = $sth -> fetchall_arrayref ;
$sth = $dbh->prepare ("select proim from products where proid ='DS10'");
$sth->execute;
$image = $sth -> fetchall_arrayref ;
#Special 2
$sth = $dbh->prepare ("select prona from products where proid ='301DS'");
$sth->execute;
$special = $sth -> fetchall_arrayref ;
$sth = $dbh->prepare ("select prosa from products where proid ='301DS'");
$sth->execute;
$costs = $sth -> fetchall_arrayref ;
$sth = $dbh->prepare ("select proim from products where proid ='301DS'");
$sth->execute;
$pic = $sth -> fetchall_arrayref ;
-]
|

|