close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Adding a "fixed" search requirement to a DA Search feature.

Thread began 3/14/2014 7:20 am by sandy170299 | Last modified 3/14/2014 9:30 am by Jason Byrnes | 850 views | 4 replies |

sandy170299

Adding a "fixed" search requirement to a DA Search feature.

I have a recordset which is filtered by DA Search, about 6 different fields. Now, I need to add additional criteria to the recordset - not part of the search, but just a "fixed" condition which needs to be present apart from all of the other search parameters. This is my query ... Where would I put the additional parameter? The additional criteria would be "AND listingstatus = 0."

mysql_select_db($database_lostfound, $lostfound);
$query_getResults = "SELECT lostdogs.ID, members.memberID, members.fname, members.lname, members.organization, members.email, members.phone, members.state AS memberState, lostdogs.listingtype, lostdogs.listingstatus, lostdogs.nameofdog, lostdogs.datemissing, lostdogs.datefound, lostdogs.city, lostdogs.county, lostdogs.state, lostdogs.gender, lostdogs.breedingstatus, lostdogs.breedtype, lostdogs.color, lostdogs.colorother, lostdogs.BlondeUnderbelly, lostdogs.photo, lostdogs.photo2, lostdogs.photo3, lostdogs.keywords
FROM lostdogs LEFT JOIN members ON lostdogs.memberID = members.memberID";
setQueryBuilderSource($query_getResults,$WADbSearch1,false);
$query_limit_getResults = sprintf("%s LIMIT %d, %d", $query_getResults, $startRow_getResults, $maxRows_getResults);
$getResults = mysql_query($query_limit_getResults, $lostfound) or die(mysql_error());
$row_getResults = mysql_fetch_assoc($getResults);

Sign in to reply to this post

sandy170299

I've added this to the end of the search criteria, but it isn't making any difference:

//comparison list additions
$WADbSearch1->addComparisonFromEdit("lostdogs.state","state","AND","=",0);
$WADbSearch1->addComparison("county","".((isset($_POST["county"]))?$_POST["county"]:"") ."","AND","Includes",0);
$WADbSearch1->addComparison("city","".((isset($_POST["city"]))?$_POST["city"]:"") ."","AND","Includes",0);
$WADbSearch1->addComparison("gender","".((isset($_POST["gender"]))?$_POST["gender"]:"") ."","AND","=",1);
$WADbSearch1->addComparison("breedingstatus","".((isset($_POST["breedingstatus"]))?$_POST["breedingstatus"]:"") ."","AND","=",1);
$WADbSearch1->addComparison("keywords","".((isset($_POST["keywords"]))?$_POST["keywords"]:"") ."","AND","Includes",0);
$WADbSearch1->addComparison("listingstatus","0","AND","=",1);

Sign in to reply to this post

Jason ByrnesWebAssist

add a where clause to the recordset.

change the end of the recordset:
LEFT JOIN members ON lostdogs.memberID = members.memberID

to:
LEFT JOIN members ON lostdogs.memberID = members.memberID WHERE listingstatus = 0

Sign in to reply to this post

sandy170299

Thank you!

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

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