close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Export search results to csv?

Thread began 4/03/2017 2:57 pm by art226587 | Last modified 4/05/2017 10:54 am by Ray Borduin | 2508 views | 8 replies |

art226587

Export search results to csv?

Hi, I've set up a search form that returns results for a 'status' field containing Yes, No & Maybe values. The search results page works great. I'm just trying to get a download button to export only the status=Yes entries if that's what someone searched for. I have created an export button for all entries and that works great. I thought it would be as simple as adding some queries to the export.php URL, but that's rather noob of me. ;-)

Do I need to add something to the export.php file that recognizes the search term and only exports those rows? I'm clearly outta my league. Thanks in advance!!

Sign in to reply to this post

Ray BorduinWebAssist

You should be able to use the same search code from your results page and add it to your export page. Is your export page built with a recordset like your results?

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

art226587

Thanks, Ray. Export page attached.

Sign in to reply to this post

Ray BorduinWebAssist

I'll need to see a copy of the results page. Then I can probably advise on adding the search from the results into the export.

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

art226587

Results page attached!

Sign in to reply to this post

Ray BorduinWebAssist

Try this

Attached Files
export-1.php
Sign in to reply to this post
Did this help? Tips are appreciated...

art226587

Hey Ray, this is still exporting all entries. Any other thoughts?

Sign in to reply to this post

Ray BorduinWebAssist

Line 57 should have been:

setQueryBuilderSource($sqlStatement,$WADbSearch1,false);

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

art226587

Nailed it! So I see that you added the WADbSearch code from the search page and then included these two lines to the 'fetch data' sql statement:

setQueryBuilderSource($sqlStatement,$WADbSearch1,false);
$rows = mysql_query($sqlStatement);



So simple - thanks again, Ray!

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