numero = 280
[SQLconnect dbType=MySQL&host=192.168.1.1&database=base&uid=sa&pwd=pass&conn_var=conn1]Connected successfully
[/SQLconnect][SQLexecute conn_ref=conn1&result_var=rs1]select firstName,lastName from employees;[/SQLexecute][SQLresult result_ref=rs1][numfound] records found<br><table border=1><tr><th>First Name</th><th>Last Name</th></tr>[founditems]<tr><td>[firstName]</td><td>[lastName]</td></tr>[/founditems]</table>[/SQLresult]
Parameter | Description |
---|---|
result_ref (or just 'ref') | (Required) - The name of the SQLResult variable you created with a prior execution of [SQLexecute] (the value you set for the "result_var" or "var" parameter) |
Tag | Description |
---|---|
[commandtext] | The SQL command string that was executed via the [SQLexecute] context. |
[numfound] | A number indicating how many records were returned as the result of the SQL statemtnt (a 'select' staement in most cases). Some SQL statements will not result in a record set, i.e. DELETE, INSERT, DROP, etc... In these cases [numfound] will be zero. |
[numfields] | A number indicating the number of fields in the returned record set. |
[numrowsaffected] | The number of rows changed by an INSERT/UPDATE/DELETE command. |
[insertID] | The insert ID of a successfull INSERT command. |
[founditems]...[/founditems] | Normally you put a [founditems] loop inside a [SQLrelease] context to retrieve the records resulting from a SQL SELECT statement, so you can display all the matching records. You can put any record set field name inside the [FoundItems] loop to display them in HTML.There are other SQL commands that will return a records set. For example, in MySQL, the following statements will return a record set:"show tables;""show processlist;""describe <table>;" |
[SQLconnect dbType=MySQL&host=192.168.1.1&database=base&uid=sa&pwd=pass&conn_var=conn1][/SQLconnect][SQLexecute conn_ref=conn1&result_var=rs1]select * from employees;[/SQLexecute][SQLresult result_ref=rs1][numfound] records found<br><table border=1><tr>[listfields]<th>[fieldname]</th>[/listfields]</tr>[founditems]<tr>[listfields]<td>[interpret][[fieldname]][/interpret]</td>[/listfields]</tr>[/founditems]</table>[/SQLresult]You can also use the new [field], inside [founditems], to retrieve field data by the fields position in the records set. For example:
[SQLconnect dbType=MySQL&host=192.168.1.1&database=base&uid=sa&pwd=pass&conn_var=conn1][/SQLconnect][SQLexecute conn_ref=conn1&result_var=rs1]select * from employees; [/SQLexecute][SQLresult result_ref=rs1][founditems][loop start=1&end=[numfields]][field seek=ordinal:[index]&get=NAME]: <b>[field seek=ordinal:[index]&get=VALUE]</b> [hideif [index]=[numfields]]- [/hideif][/loop]<br>[/founditems][/SQLresult][SQLresult Params]Found Items[/SQLresult]
[SQLconnect dbType=MySQL&host=192.168.1.1&database=base&uid=sa&pwd=pass&conn_var=conn1]
Connected successfully
[/SQLconnect]
[SQLexecute conn_ref=conn1&result_var=rs1]
select firstName,lastName from employees;
[/SQLexecute]
[SQLresult result_ref=rs1]
[numfound] records found<br>
<table border=1><tr><th>First Name</th><th>Last Name</th></tr>
[founditems]
<tr><td>[firstName]</td><td>[lastName]</td></tr>
[/founditems]
</table>
[/SQLresult]
Parameter | Description |
---|---|
result_ref (or just 'ref') | (Required) - The name of the SQLResult variable you created with a prior execution of [SQLexecute] (the value you set for the "result_var" or "var" parameter) |
Tag | Description |
---|---|
[commandtext] | The SQL command string that was executed via the [SQLexecute] context. |
[numfound] | A number indicating how many records were returned as the result of the SQL statemtnt (a 'select' staement in most cases). Some SQL statements will not result in a record set, i.e. DELETE, INSERT, DROP, etc... In these cases [numfound] will be zero. |
[numfields] | A number indicating the number of fields in the returned record set. |
[numrowsaffected] | The number of rows changed by an INSERT/UPDATE/DELETE command. |
[insertID] | The insert ID of a successfull INSERT command. |
[founditems]...[/founditems] | Normally you put a [founditems] loop inside a [SQLrelease] context to retrieve the records resulting from a SQL SELECT statement, so you can display all the matching records. You can put any record set field name inside the [founditems] loop to display them in HTML.There are other SQL commands that will return a records set. For example, in MySQL, the following statements will return a record set:"show tables;""show processlist;""describe <table>;" |
[SQLconnect dbType=MySQL&host=192.168.1.1&database=base&uid=sa&pwd=pass&conn_var=conn1]
[/SQLconnect]
[SQLexecute conn_ref=conn1&result_var=rs1]
select * from employees;
[/SQLexecute]
[SQLresult result_ref=rs1]
[numfound] records found<br>
<table border=1>
<tr>
[listfields]<th>[fieldname]</th>[/listfields]
</tr>
[founditems]
<tr>
[listfields]<td>[interpret][[fieldname]][/interpret]</td>[/listfields]
</tr>
[/founditems]
</table>
[/SQLresult]
[SQLconnect dbType=MySQL&host=192.168.1.1&database=base&uid=sa&pwd=pass&conn_var=conn1]
[/SQLconnect]
[SQLexecute conn_ref=conn1&result_var=rs1]
select * from employees;
[/SQLexecute]
[SQLresult result_ref=rs1]
[founditems]
[loop start=1&end=[numfields]]
[field seek=ordinal:[index]&get=NAME]: <b>[field seek=ordinal:[index]&get=VALUE]</b> [hideif [index]=[numfields]]- [/hideif]
[/loop]<br>
[/founditems]
[/SQLresult]
DOWNLOAD WEBDNA NOW!
A list of user-submitted tips ...
F.A.QA compilation of some user's questions...
AWS Raw WebDNA LAMP-Plus WebServerAmazon Web Services (AWS) README for Machine Image ID...
[biotype]BioType is a behavioral biometrics WebDNA function based on ADGS research and development (from version 8...
Technical Change HistoryThis Technical Change History provides a reverse chronological list of WebDNA changes...
Download WebDNA ApplicationsWebDNA applications...
Using [password] and [username] is an easy was to show the browser login dialog box...
[filecompare]Compares the size...
[platform]...
[deletefile]Deleting a file from your website...
[include]Include the contents of the specified file...
[listmimeheaders]Lists all the MIME header names and values sent from the remote browser...