Defining sources of dynamic content – Adobe Dreamweaver CC 2014 v.13 User Manual
Page 611
Defining sources of dynamic content
Define a recordset without writing SQL
Define an advanced recordset by writing SQL
Create SQL queries using the Database Items tree
Define URL parameters
Define form parameters
Define session variables
Define application variables for ASP and ColdFusion
Use a variable as a data source for a ColdFusion recordset
Define server variables
Cache content sources
Change or delete content sources
Copy a recordset from one page to another page
Note: The user interface has been simplified in Dreamweaver CC and later. As a result, you may not find some of the options described in this
article in Dreamweaver CC and later. For more information, see
.
Define a recordset without writing SQL
You can create a recordset without manually entering SQL statements.
1. In the Document window, open the page that will use the recordset.
2. Select Windows > Bindings to display the Bindings panel.
3. In the Bindings panel, click the Plus (+) button and select Recordset (Query) from the pop-up menu.
The simple Recordset dialog box appears. If you are developing a ColdFusion site, the Recordset dialog box is slightly different. (If the
advanced Recordset dialog appears instead, click the Simple button to switch to the simple Recordset dialog box.)
4. Complete the Recordset dialog box for your document type.
For instructions, see the topics below.
5. Click the Test button to execute the query and ensure that it retrieves the information you intended.
If you defined a filter that uses parameters input by users, enter a value in the Test Value box, and click OK. If an instance of the recordset
is successfully created, a table appears that displays data extracted from the recordset.
6. Click OK to add the recordset to the list of available content sources in the Bindings panel.
Options for the simple Recordset dialog box (PHP, ASP)
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 the code, for example:
rsPressReleases.
Recordset names can only contain letters, numbers, and the underscore character (_). You cannot use special characters or spaces.
2. Select a connection from the Connection pop-up menu.
If no connection appears in the list, click Define to create one.
3. In the Table pop-up menu, select the database table that will provide data to the recordset.
The pop-up menu displays all tables in the specified database.
4. To include a subset of the table’s columns in the recordset, click Selected and choose the desired columns by Control-clicking (Windows) or
Command-clicking (Macintosh) them in the list.
5. To further limit the records returned from the table, complete the Filter section:
From the first pop-up menu, select a column in the database table to compare against a test value you define.
From the second pop-up menu, select a conditional expression to compare the selected value in each record against the test value.
From the third pop-up menu, select Entered Value.
In the box, enter the test value.
604