<HTML>
<HEAD>
<TITLE>WebSmith's Concerts-we'd-like-to-see Database</TITLE>
</HEAD>
<BODY BGCOLOR=#FFFFFF>
<H1>WebSmith's Concerts-we'd-like-to-see Database</H1>
<hr>
<H2>Master Concert Listing for
<! msql print "$cityname" >
</H2>
<!-- Connect to the "concerts" database -->
<! msql connect >
<! msql database concerts >
<!-- Issue the query, here
we are selecting all records ("*") from the
"listings" table, placing the results
in a query handle called "q1".
This query handle will be used below to display the data. -->
<! msql query "select * from listings where location like
'%$cityname%'" q1>
<!-- Let's put the data in a table, it looks nicer -->
<TABLE border=1>
<!-- Some simple header info for the table -->
<TR>
<TH ALIGN=LEFT>SHOWDATE</TH>
<TH ALIGN=LEFT>HEADLINER</TH>
<TH ALIGN=LEFT>OPENING ACT</TH>
<TH ALIGN=LEFT>LOCATION</TH>
<TH ALIGN=LEFT>PRICE</TH>
</TR>
<!-- Here is where we have w3-msql
display all the data retrieved from
the query stored in the query handle "q1".
Note the mixture of
HTML and mSQL commands. Here, we are simply
building a table "row"
for every database "row" retrieved in the query. -->
<! msql print_rows q1
"<TR>\
<TD><font size=-1>@q1.0</font></TD>
<TD><font size=-1>@q1.1</font></TD>
<TD><font size=-1>@q1.2</font></TD>
<TD><font size=-1>@q1.3</font></TD>
<TD><font size=-1>@q1.4</font></TD>
</TR>">
<!-- When we are done, let's close the table properly -->
</TABLE>
<! —Free up the query handle-we are done with it -->
<! msql free q1>
</BODY>
</HTML>
Copyright © 1994 - 2019 Linux Journal. All rights reserved.