database.SQLTable()

NES2+Syntax

							database.SQLTable(SQL)

Description

The SQLTable() method of the database object takes a SQL SELECT statement as a parameter and executes this query through the connection from which it was called. It returns the results formatted in an HTML table for easy writing to a client's page. This is a simple table in the following format:

<TABLE BORDER>
<TR>
<TH>column 1</TH>
<TH>column 2</TH>
…
<TH>column N</TH>
</TR>
<TR>
<TD>value 1 of column 1</TD>
<TD>value 1 of column 2</TD>
…
<TD>value 1 of column N</TD>
</TR>
<TR>
<TD>value 2 of column 1</TD>
<TD>value 2 of column 2</TD>
…
<TD>value 2 of column N</TD>
</TR>
…
</TABLE>

Example

Listing 8.51 runs a user passed query and formats the result using the SQLTable() ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.