close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

QueryString Filtering

Thread began 6/13/2011 3:00 pm by mike292921 | Last modified 6/15/2011 4:39 pm by Jason Byrnes | 1514 views | 11 replies |

mike292921

QueryString Filtering

I got the dataassist querystring bind to work.

I know how to pass the values however I don't know how to filter data to display the proper items from my database. I believe this can be done with dataassist sort, Just don't know what option to click on.

Example say $_GET['ID']
$_GET['Color']

How can I get those values to pull from my mysql the same data found in the columns.
Say ID would actually be the Itemsname column in mysql and Color would be Color column in mysql. Color Column Blue=Blue so that it displays all columns with same value.

Thank You!

Sign in to reply to this post

Jason ByrnesWebAssist

No recordset filtering is not done using Data Assist sort. Data Assist sort is used to sort the recordset results, not filter.


to filter the recrdset, you need to add a where clause.

in the record set go into advanced view.



In the SQL window, you should see the select statement for the recordset like:

SELECT * FROM tbleName


add a where clause for the column names you want to filter, for example if the 2 columns in the table that you want to filter on ar ID and color:

SELECT * FROM tbleName
WHERE ID= paramID AND color = paramColor


in the variables section, create 2 new variables as:

Name: paramID
type: Integer
default value: -1
run time value: $_GET['ID']

Name: paramColor
type: text
default value: -1
Run time value: $_GET['Color']

Sign in to reply to this post

mike292921

...

Thank You

I have been working on that but how could I just pull ID, right now I can only pull ID and Color.

example.com/ID?= Can't get it to work.
example.com/ID?=&color= does work.

Sign in to reply to this post

Jason ByrnesWebAssist

change the where clause to OR:

WHERE ID= paramID OR color = paramColor

Sign in to reply to this post

mike292921

...

Thanks Again!

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

mike292921

Any way that I can get the values of the parameter to work with the data displayed

?ID=brand
show only the brands

?ID=brand&Color=Blue
show the color related to the brand selected

I know the OR choose between the 2 columns but how do I get them to relate?

Sign in to reply to this post

Jason ByrnesWebAssist

you would need to add an order by clause:

WHERE ID= paramID OR color = paramColor ORDER BY ID

Sign in to reply to this post

mike292921

Ok comes back to what I first asked. I use Dataassist Wizard and Ecart but I wanted to understand how to make my site more dynamic.

I asked originally about Sort with Dataassist. Can I skip that and use Dataassist QueryString Binding to create the parameter url itself based on the values ID, Color and how should I set up a link to make this function work?

I believe that is the reason why it still won't work until I get that to work.

Thank You!

Sign in to reply to this post

Jason ByrnesWebAssist

no, the sort will not filter your records.

sort merely puts the returned record in order using an ORDER BY clause.

to filter your records, either use a WHERE clause in your recordset, or you can use data Assist Search

To Create the URL Parameter in the bindings tab, click the Plus button and select URL Variable.

The data assist query string binding is only used with the sort server behavior.

Sign in to reply to this post
loading

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...