[founditems], the companion context to [search], loops through the records retrieved by the search, and provides the means to display data from each record.
The [founditems] context goes between the search tags. If the search specified a maximum number of matches, then only that many will be displayed in the [founditems] loop.[search db=xx.db&eqCITYdata=Chicago]
[founditems]
[index]. <b>[Name]</b>, [Address], [City]<hr>
[/founditems]
[/search]
[fieldname] | Enclose any fieldname in square brackets to display the value |
[index] | A number indicating this record's placement in the list. Note that this number is not taken from the database, but is purely a counter as the records are retrieved. When records are split into chunks with the [shownext] context, subsequent pages will start with the index true to the total search, not just the group found on that page. |
[break] | From version 8.1, if the [founditems] context sees the [break] tag while executing a loop, it will stop looping, once it finishes the current loop. Thus the [break] tag should only appear in a [showif] statement that is evaluated at the end (bottom) of the loop. |
Parameter | Description |
---|---|
Iterate Only available within [SQLresult] | (Optional) - Manual/Auto - When set to MANUAL, the [founditems] context switches to 'manual' mode. The new [Seek] tag must then be used to 'move' the record set cursor. The cursor is always initialized to the first record position. When set to Auto - [founditems] reverts to default behavior, iterating the record set one record at a time, starting from the first item, and ending with the last item. |
Tag | Description |
---|---|
The following tags are only valid when [founditems] is used with a [SQLresult] context. | |
[Field Params] | The [field] tag is used within [founditems] to return information about a particular field of the current record. Parameters: seek (required) - The seek parameter uses a prefix-qualified naming semantic to select a specific field of the current record. You can use one of two possible prefixes for the value of the seek parameter... either named or ordinal; follow this with a ":" and the actual value which identifies the field (according to the prefix-qualifier). For example: seek=ordinal:1 - would select the first field seek=named:employeeID - would select the field named "employeeID" get (optional) - The get parameter accepts one of seven possible enumerated values: NAME - Retrieves the field name. ORDINAL - Retrives the field position. DATATYPE - Retrievs the field data type. WIDTH - Retrieves the max data length. ALLOWNULL - T/F Resolves to 'T' if the field will accept a NULL value. ISNULL - T/F Resolves to 'T' if the field value is NULL. VALUE - Retrieves the field value. raw (optional) - When retrieving field data where the field data type is: DATE, TIME, or DATETIME , WebDNA will 'interpret' the data based on the user defined WebDNA preferences for displaying Dates and Times. However, if you wish to display the data in its 'raw' format, you can set the 'raw' parameter to 'T'. |
[founditems]
[dateacquired]
[field seek=named:dateAcquired&get=value&raw=T]
[/founditems]
[Seek Params] | When the 'iterate' parameter for [founditems] is set to 'manual'. The [seek] tag is used to position the result set 'cursor' to a particular record.
|
[SQLresult result_ref=rs1]Terry Wilson
List records in reverse order:
<table>
<tr><th>ID</th><th>Date Acquired</th><th>Comments</th></tr>
[founditems iterate=manual]
[seek to=last]
[loop start=1&end=[numfound]]
<tr><td>[inventoryID]</td><td>[dateAcquired]</td><td>[comments]</td></tr>
[hideif [index]=[numfound]][seek to=prev][/hideif]
[/loop]
[/founditems]
</table>
[/SQLresult]
DOWNLOAD WEBDNA NOW!
A list of available libraries for WebDNA...
WebDNA ModulesA list of the currently available modules...
WebDNA referenceA list of all WebDNA instructions...
Tips and TricksA list of user-submitted tips ...
AWS Raw WebDNA LAMP-Plus WebServerAmazon Web Services (AWS) README for Machine Image ID...
Technical Change HistoryThis Technical Change History provides a reverse chronological list of WebDNA changes...
...
[setmimeheader]Causes WebDNA to add a new MIME header to the outgoing HTML...
[boldwords]Highlights matching words with boldface HTML tags...
[hideif][HideIf Comparison]Hide This HTML[/HideIf]...
[writefile][writefile] functions allows you to perform a wide variety of tasks...
[SQLinfo]...