beautypg.com

Adobe Dreamweaver CC 2015 User Manual

Page 576

background image

569

Dynamic sites, pages and web forms

Last updated 6/3/2015

4

If the SQL statement contains variables, define their values in the Variables area by clicking the Plus (+) button and
entering the variable’s name, type (integer, text, date, or floating point number), default value (the value the variable
should take if no run-time value is returned), and run-time value.

Note: When using variables in a SQL statement in PHP, Dreamweaver automatically adds a leading dollar sign to the
variable name, so you should omit the dollar sign (e.g., colname, instead of $colname).

If the SQL statement contains variables, make sure the Default Value column of the Variables box contains valid test
values.

The run-time value is usually a URL or form parameter entered by a user in an HTML form field.

URL parameters in the Run-time Value column:

Form parameters in the Run-time Value column:

5

Click Test to connect to the database and create an instance of the recordset.

If the SQL statement contains variables, make sure the Default Value column of the Variables box contains valid test
values before clicking Test.

If successful, a table appears displaying the data in your recordset. Each row contains a record and each column
represents a field in that record. Click OK to clear the recordset.

6

If satisfied with your work, click OK.

Options for the advanced Recordset dialog box (ColdFusion)

Use the advanced Recordset dialog box to write custom SQL queries, or use the Database Items tree to author SQL
queries using a point-and-click interface.

1

In the Name box, enter a name for the recordset.

A common practice is to add the prefix rs to recordset names to distinguish them from other object names in your
code. For example: rsPressReleases

Recordset names can only contain letters, numbers, and the underscore character (_). You cannot use special
characters or spaces.

If you’re defining a recordset for a ColdFusion component (that is, if a CFC file is currently open in Dreamweaver),
select an existing CFC function from the Function pop-up menu, or click the New Function button to create a new
function.

Note: The Function pop-up menu is only available if a CFC file is the current document and you have access to a
computer running ColdFusion MX 7 or better.

The recordset is defined in the function.

2

Select a data source from the Data Source pop-up menu.

Server Model

Run-Time value expression for URL parameter

ASP

Request.QueryString(“formFieldName”)

PHP

$_GET['formFieldName']

Server Model

Run-Time value expression for form parameter

ASP

Request.Form(“formFieldName”)

PHP

$_POST['formFieldName']