close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Search/Results Page Problem

Thread began 4/28/2010 3:46 pm by fabianmacs370894 | Last modified 5/03/2010 2:09 pm by fabianmacs370894 | 3526 views | 19 replies |

fabianmacs370894

Search/Results Page Problem

I have an Events DB, one table has the parent fields: date_1, date_2, category, event. I then have a second table for id & dates ie 3rd July 2010 till 18th July 2010. Most events have just one date, though a few have more than one. I have created a results page with the parent columns. I have also a search page to search the events based on a date from a dynamic dropdown list. I want it to search for only events on the eg. 7th July 2010 and not any other date. Currently, if I search for all events on the 7th July it also displays the other date eg 6th July because the event is on both dates and I have two table columns date_1 and date_2.

Check out link and do search on 7th July:

search.php

Any help is much appreciated.

Thanks.

Attached Files
search-results.zip
Sign in to reply to this post

Jason ByrnesWebAssist

If you set the search to use both columns, date_1 and date_2, this is the correct result.

you would need to configure the search to only look in one of those columns to be able to get the result you are looking for.

Sign in to reply to this post

fabianmacs370894

Configure

Jason, any idea how I would go about configuring the search to show only one? My skills are quite basic when it comes to this kinda thing.

Thanks for any help in advance.

Sign in to reply to this post

Jason ByrnesWebAssist

in the data assist search wizard, for the keyword search, you have selected both the date_1 and date_2 columns.

You should edit this and select only 1 of the date columns.

Sign in to reply to this post

fabianmacs370894

Search Dates on all colunms

Jason,

problem is, I have have about 6 columns for date_1, date_2, date_3 etc because a few of the events are on more than one date. See attachment. On one of the events the 7th July is in column date_1, whereas it may be on column date_2 on another event. But I want it to search though all the date columns but only display the event from say the 7th July and not showing the date of 6th July from 1st Column. I know this must sound confusing but I just can't think of any other method to do this and deadline is looming.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

Well, you could put an if statement around the date date display so it will only show if that column is equal to the searched date:

php:
<?php if($row_rsResults['date_1'] == $_POST["searchForm"]) echo $row_rsResults['date_1']; ?>


<?php if($row_rsResults['date_2'] == $_POST["searchForm"]) echo $row_rsResults['date_2']; ?>
Sign in to reply to this post

fabianmacs370894

If statement

Jason,

My knowledge of PHP is practically zero. Any idea of where I would put this IF statement on the page. I attached the results page as attachment on the first post here, does it go on that page?

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

yes, on the results page you sent me, you are displaying the date using:

php:
<td><p><?php echo $row_rsResults['date_1']; ?>,<?php echo $row_rsResults['date_2']; ?></p></td>




change that to:

php:
<td><p><?php if($row_rsResults['date_1'] == $_POST["searchForm"]) echo $row_rsResults['date_1']; ?>,<?php if($row_rsResults['date_2'] == $_POST["searchForm"]) echo $row_rsResults['date_2']; ?></p></td>
Sign in to reply to this post

fabianmacs370894

IF STATEMENT Results Page

Jason,

Thank so much for that - will replace the text and see how it goes.

Sign in to reply to this post

fabianmacs370894

Empty Date field when no selection is made.

Jason,

That PHP code worked perfect.

Issue now is that if I don't select any item from dropdown list, it shows ALL categories ok on results page, but no dates are showing.

See link - press submit with no selection:

search.php

Results page is attached too.

Attached Files
29.04.zip
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...