URL parameter filters with where clauses

3 posts by 2 authors in: Forums > CMS Builder
Last Post: August 27, 2012   (RSS)

Re: [InHouse] URL parameter filters with where clauses

By Jason - August 24, 2012

Hi,

If you already have a value in the 'where' option, whatever you put in the URL will be appended to that where clause.

One thing you could do is to check to see if there is a value for "type" in the URL. If there is, don't set a where clause.

For example:

$where = "";

if (!@$_REQUEST['type']) {
$where = "put your where clause here";
}


You can then use $where in your where clause. If there's a value of type in the URL, $where will be blank, so just the automatic searching will occur.

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] URL parameter filters with where clauses

By InHouse - August 27, 2012

Many thanks Jason. That would seem to explain the change in behaviour. The solution you offer will work nicely I'm sure.

J.