close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

search criteria

Thread began 1/16/2012 8:17 am by info97301 | Last modified 1/26/2012 6:58 am by Jason Byrnes | 2584 views | 11 replies |

info97301

search criteria

Hi

I have a table with PgID, Under_PgID, PgType etc fields. The PgID is the primary key, autonumber. The Under_PgID contains the PgID number of a page that it is 'under' in the menu structure.

I have a search form that works quite well (bar one issue that is on another post) - but I want to be able to search for pages PgType = 1 AND Under_PgID IS NULL

I read in the forums that searching for null values isn't possible with DA, so I wondered if there is a way to create a temporary field that inserts a value where the above criteria are met. This would then enable me to put another search value in place.

For example, if PgType=5 AND Under_PgID IS NULL, insert 'top' into temporary field 'TopPage'.

Whichever solution is possible, I'd be obliged for guidance

Thanks
Chris

Sign in to reply to this post

Ray BorduinWebAssist

Searching for Null is possible with DA. I don't think a temporary table will be necessary. Do you always want only results where that field is null in your results or are you responding to a form element like a checkbox?

You may be able to just add "WHERE Under_PgID IS NULL" to the recordset directly and then the DA search will add " AND PgType = 1" according to t he search criterion.

Sign in to reply to this post
Did this help? Tips are appreciated...

info97301

Hi Ray

Thanks for the speedy reply.

There are a number of different searches on the page, including where PgType = 3 or 4 etc and in these instances the Under_PgID may or may not be null. Equally, there may be pages of PageType = 5 that have an Under_PgID not null, so I don't think I can write it in the recordset

Cheers
Chris

Sign in to reply to this post

Ray BorduinWebAssist

So, how would you determine when to add the IS NULL or not? Is there a checkbox?

Sign in to reply to this post
Did this help? Tips are appreciated...

info97301

Hi Ray

I've done things slightly differently now, so that 'under pages' are accessed after the initial search.

However, to simplify things, when the page is opened, I'd like just to show the pages WHERE PgType = 1 AND Under_PgID IS NULL

So how do I get the 'IS NULL' into the url ??? below

/pages_Results.php?S_PgID=&S_PgTypeID=1&S_Under_PgID=???&S_PgTitle=&S.....

Or how should I achieve it?? Can the recordset have something like if parameter xyz exists, Under_PgID IS NULL, else ignore it.

Thanks

Chris

Sign in to reply to this post

Jason ByrnesWebAssist

this would require some hand coding to accomplish. send a copy of your page please so i can see what you have set up already and advise on what to change.

Sign in to reply to this post

info97301

Hi Jason

Many thanks - I have split the file in two.

Cheers
Chris

Attached Files
pages_Results-body.txt
pages_Results.txt
Sign in to reply to this post

Jason ByrnesWebAssist

please compress the original php file into a zip archive and attach the zip file.

Sign in to reply to this post

info97301

Hi Jason

zip attached.

thanks
Chris

Attached Files
pages_Results.zip
Sign in to reply to this post

Jason ByrnesWebAssist

so, you want to default to searching for
PgType = 1 AND Under_PgID IS NULL

is no search criteria is entered? Is that it?

if so, set the default where clause in the data assist search behavior to:
PgType = 1 AND Under_PgID IS NULL

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