Dynamic Search Suite: Frequently Asked Questions
Q: Does the extension work with Dreamweaver MX?
A: Yes.
Q: Does the extension work with Dreamweaver MX 2004?
A: Yes.
Q: Does the extension work with hand-coded pages?
A: No. The extension works in conjunction with pages that use the Dreamweaver MX recordsets.
Q: Do I need to enter anything in the second tab (Advanced)?
A: Only if you want to add some of the more advanced features, such as adding radio buttons/select box for Any Words, All Words, and Exact Phrase searches, or if you have an existing WHERE clause that you want to keep in addition to the new WHERE clause written by the server behavior
Q: Does the extension work with UltraDev?
A: The ASP/VBScript version of the extension has a separate download for an UltraDev-only version, for UltraDev 4. UltraDev 1 had a completely different architecture and is not supported. The PHP and CF versions DO NOT work with UltraDev. It also works with Dreamweaver MX.
Q: I tried to apply the extension to a table that displays the results of a stored procedure, but it isn't searching. Does it work with stored procedures?
A: It won't work with a standard stored procedure that returns a resultset because the SQL is generated dynamically by the extension. However, through careful hand coding you can adapt your stored procedure to accept a dynamic WHERE clause and make use of the extension. The extension is not supported for this type of page, though.
Q: I'm using the Sort Repeat extension on a search page, but when I click the table heading, I lose the search parameters.
A: There could be one of two problems: either you didn't fill in the box for "Use These Parameters" in the Sort Repeat Region extension, or you are using a Form-specifc variable reference in your recordset. When you create recordsets in UltraDev or Dreamweaver MX using the Simple recordset dialog box, the dialog box allows you to filter by form variable or by querystring variable. However, the way that many of the UltraDev or Dreamweaver MX server behaviors work is to allow you to use a Post method in your form, thereby filtering the recordset by the form variable, but on the second pass when you click a link to take you to the next set of results you are using a querystring variable instead of a form variable. You can do this by using a generic request variable instead of specifying a form variable. In other words, don't use this:
Request.Form("myFormVariable") ASP
#Form.myFormVariable# ColdFusion
instead, use this:
Request("myFormVariable") ASP
#myFormVariable# ColdFusion
Q: Does this server behavior work with the Recordset Navigation Suite or the Sort Repeat Region server behavior?
A: Yes, it is fully compatible with those extensions.
Q: Which PHP server model does the extension work with?
A: It works only with the MySQL server model in Dreamweaver MX.
Q: Can I use the extension with two recordsets or search two tables in a database?
A: There is really no way to do this with a standard search, but you can do it in a View (SQL Server) or Query (Access), and then use that on your page instead of the database table. In order for that to work, you have to create a view that uses a UNION, and the fields have to match. I usually give each column name an alias if the table columns don't match, like this:
SELECT table1_myfield as myfield
, table1_myfield2 as myfield2
, table1_myfield3 as myfield3
, '' as myfield4
FROM table1
UNION
SELECT table2_anotherfield as myfield
, table2_anotherfield2 as myfield2
, table2_anotherfield3 as myfield3
, table2_anotherfield4 as myfield4
FROM table1
ORDER BY myField, myField2, myField3,myField4
Notice that the first table in my query is short by one column, so I merely created an alias to an empty string to complete the UNION. Then you merely have to use the View in your page:
SELECT * FROM myView
If your database does not support views, you might be able to code the SQL in your page instead.
Q: Using the PHP version, can I use the extension the POST method and return multiple results pages using recordset navigation?
A: Unfortunately, this is a function of the navigation behaviors. They are set up to use the query string, not the form post. Indeed, the only advantage to using a POST method is to hide the parameters from the user, but recordset navigation will not work with a hidden query string. For that reason, it is better to use the GET method when dealing with multi-page search results.
Having said that, there is a way to add the post variable to the querystring:
after this section appears:
if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) {
$params = explode("&", $HTTP_SERVER_VARS['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . implode("&", $newParams);
}
}
add this code:
if(isset($_POST["search"])) {
$queryString_Recordset1 = sprintf("&search=%s%s", $_POST["search"], $queryString_Recordset1);
}
Substitute your own search parameter and your own recordset name.
Q: Can I use the Dynamic Search Suite with other filters or dropdown lists?
The Dynamic Search Suite does not have built-in functions to add more filters because it is designed as a keyword search, however you can add your using Dreamweaver's built-in functionality. It is best to do this before adding the search extension to the page. To add one search filter (in addition to a keyword search) use the Simple recordset dialog box in Dreamweaver and choose to filter your recordset by a URL parameter with the name of your form field (assuming you are using the GET method in your search form, which is preferable for a search.) After adding your search parameter to the recordset, you can then add the Dynamic Search extension to the page and choose to "Leave Where Clause Intact" in the advanced tab. This will keep your filter operational in addition to the keyword search.
To add multiple filters, use the Advanced recordset dialog box and add each parameter into the SQL as you would normally. For example, if you have two dropdowns named "Make" and "Model", with a keyword search field named "search", you would set up your recordset like this:
SELECT field1, field2, field3
FROM mytable
WHERE field1 LIKE 'Make'
AND field2 LIKE 'Model'
Add parameters to the recordset dialog box:
ASP
Name | Default | Runtime value |
---|---|---|
Make | % | Request("Make") |
Model | % | Request("Model") |
PHP
Name | Default | Runtime value |
---|---|---|
Make | % | $_GET["Make"] |
Model | % | $_GET["Model"] |
ColdFusion
SELECT field1, field2, field3
FROM mytable
WHERE field1 LIKE '#url.Make#'
AND field2 LIKE '#url.Model#'
Name | Default |
---|---|
url.Make | % |
url.Model | % |
Then add the Dynamic Search extension to the page and choose to "Leave Where Clause Intact" in the advanced tab. This will keep your filter operational in addition to the keyword search.