close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Creating a search form using Data Assist

Thread began 1/02/2010 9:24 am by Paul | Last modified 1/12/2010 4:52 pm by Eric Mittman | 1232 views | 7 replies |

PaulBeta Tester

Creating a search form using Data Assist

I'm using the DataAssist Search Wizard to create a search feature in my index.php page.

I have created the server behaviour and recordset for my search source used during the wizard to create my search form etc, however I was a little confused by the absence of the steps to create and link to the the results page - or have i missed something here

Would be grateful for any guidance around these steps and functionality.

Thank you, Paul

Sign in to reply to this post

Eric Mittman

If you are using the wizard to create the search and results pages then you do not need to do anything further to get the search page to go to the results page, this should be automatic for you.

If you crafting one or both of the pages outside of the wizard you would get the search page to go to the results page by making the results page the action of the search form.

Sign in to reply to this post

PaulBeta Tester

Eric,

I am using the DA Search Wizard. There are only 3 steps. There is no mention of the search results page in any of those steps.

Attached is screenshot of final page after 3 step.

Sign in to reply to this post

Eric Mittman

Sorry about that, I should have been more clear. DataAssist has two wizards, there is the standard DataAssist wizard as well as the DataAssist Search wizard. I was referring to making use of the regular DataAssist wizard, this is the one that will create the search and results pages for you. Once the pages are crafted you can edit the DataAssist Search server behavior that is on the search page to get you search working just how you would like it.

If you do not use the regular DataAssist wizard to generate the pages you can create your own search page with a form on it and just set the action of the form to your results page. This is how the search links to the results.

Sign in to reply to this post

webserv315208

Adapting Search to Customized Page

I would appreciate your assistance in figuring out why my page resulting in errors when I try to adapt an all ready customized list page (not using DA) with DataAssist's Search feature.

I did the following steps:
1. Created a form with a 'Search' textbox and a button called 'go'.
2. Accessed DataAssist Search
a. Trigger: button 'go' pressed
b. Recordset 'getEmployee', 'MySQL'
c. Default WHERE clause: "WHERE 0=0"
d. Server Behavior Configuration (I only created one for testing): Key, firstname, T=<?php echo $row_getEmployee['firstname']; ?>
3. RESULT when page first loads:
a. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE 0=0' at line 1

How can I modify your DA code to where I don't need the WHERE clause (or do I?) if I have my own query displaying the results as I want them?

Also, I all ready have SESSIONS coded, how can I adapt DA's to where I don't need it?

4. How can I use your product with my web page? I've attached my web page code for your review, which includes the DA code as well.

Thank you in advance!

Attached Files
code.txt
Sign in to reply to this post

Eric Mittman

I think the error you are getting has to do with the where clause having the word where in it. You should try updating the where clause by removing the work where in it so it looks like this:

" 0=0"

The default where clause is a filter that will be applied to the recordset when there is no search value submitted. So if you leave this at the 0=0 you should get back all the records from your recordset without any filtering.

In regards to the session variables I'm not sure that I understand what you are asking. DataAssist Search will make use of session variables to hold the previous results if you were to visit the page again without searching.

As far as the code you have it seems fine to me other than the update that you should make to the default where clause. Please give this a try and let us know if you have any other problems.

Sign in to reply to this post

webserv315208

I have made your recommended change and attempted to use the Search textbox by typing a firstname. I have receive the following errors:

Notice: Undefined variable: row_getEmployee in C:\...\list.php on line 92

Notice: Undefined variable: row_getEmployee in C:\...\list.php on line 93

Notice: Undefined variable: row_getEmployee in C:\...\list.php on line 94

Lines 92-94:
$WADbSearch1->keywordComparison($KeyArr1,"".$row_getEmployee['company'] ."","AND","=",",%20","%20","%22","%22",0);
$WADbSearch1->keywordComparison($KeyArr2,"".$row_getEmployee['firstname'] ."","AND","=",",%20","%20","%22","%22",0);
$WADbSearch1->keywordComparison($KeyArr3,"".$row_getEmployee['position'] ."","AND","=",",%20","%20","%22","%22",0);

I await your reply.

Sign in to reply to this post

Eric Mittman

Seeing these errors and looking at the code it seems that you have the search configured incorrectly. In your comparisons you are making reference to the recordset values that come from the same recordset you are applying the search on. This will not work this way since the end result of the DataAssist Search server behavior is to produce a filtered recordset, using values from this filtered recordset in your search does not make sense.

The values you are comparing to are almost always posted values from a form. You should replace these recordset references in the comparison with their posted values from the search form. This way whatever is entered into the search form is what will be used to filter the recordset.

To do this on your results page you will first need to go to Bindings > Form Data, then select your search page. After you do this edit the DataAssist search server behavior and when selecting the values for the comparison use the lightning bolt to choose the form elements from your search form where the search terms are entered.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...