Displaying records from joined tables
Table "Titles" does not contain neither author's nor publisher's name but
their respective ID numbers. In this example we joined table "Titles" with
tables "Authors" and "Publishers" (using WhizBase variable WB_RcdSet) and used
WB_DBFlds to define fields we want to include in resulting recordset. We also sorted
records by year in descending order.
[FormFields]
wb_basename=biblio.mdb
WB_RcdSet=(Authors inner join
titles on authors.au_id=titles.au_id) inner join publishers on
publishers.pubid=titles.pubid
WB_DBFlds=Title,[Year
Published],ISBN,Authors.Name as Author,publishers.Name as
Publisher
WB_Command=Q
WB_MaxRec=10
WB_Order=[Year published]
desc
<!--WB_BeginTemplate-->
<html>
<head>
<style>
.wbspttbl{
border:1px
solid
#000000;
font-family:verdana;
font-size:12px;
border-collapse:collapse;
border-spacing:0px;
}
.wbspthdr{
background-color:#CC0000;
border:1px
solid
#000000;
color:#C0C0C0;
}
.wbsptrow{
background-color:#FFCC00;
border:1px
solid #000000;
color:#0000CC;
}
</style>
<title>Simple
database
example</title>
</head>
<body>
$wbdetail[t]
</body>
</html>