close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multiple recordsets?

Thread began 2/28/2022 9:50 am by birdscreen398247 | Last modified 3/23/2023 4:53 pm by Ray Borduin | 332 views | 11 replies |

birdscreen398247

Multiple recordsets?

I have a table with the following fields: Birder_ID, CountType, CountCounty, Quantity (plus some other fields unrelated to this question).

I have a form that lists 67 counties and the Quantity that goes with each. In other words, the Quantity that would go in the Adams county field would be the Quantity from the table that has Birder_ID = ? AND CountType = 'Life' AND CountCounty = 'ADAMS' (where ? is a session variable birder_ID).

I could create 67 recordsets to retrieve this data, but is there a simpler way to do it?

Sign in to reply to this post

Ray BorduinWebAssist

Yes... You can use Count() and Group By statements in your recordset to get counts for each county.

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

birdscreen398247

There is only one record per birder per county, so I don't think Count() is appropriate here.

All I want to retrieve is the number in the Quantity field.

Sample records:

Birder_ID CountType CountCounty Quantity
23 Life ADAMS 245
23 Life MONTGOMERY 156
23 Life WARREN 212
34 Life ADAMS 175
etc.

So on the form for the birder with an Birder_ID of 23, I want ADAMS: (and a form text field with, in this case, 245)
If the birder is #34 then the number after ADAMS: would be 175, etc.

Sign in to reply to this post

Ray BorduinWebAssist

You can create a recordset that returns all of the results and then filter to show individual rows like:

<?php
$RecordsetName->filterResults([["Birder_ID",23],["CountCounty","ADAMS"]]);
?>

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

birdscreen398247

Three questions.

1. I could not find a PHP command "filterResults" online. Is this a php command or what?

2. If the recordset already filters on the Birder_ID, do I need the second set of brackets in the following line of code?

$rsPALifeList->filterResults([["CountCounty","ADAMS"]]);

3. Then, using that filter, how do I retrieve the value of the Quantity field?

Sign in to reply to this post

Ray BorduinWebAssist

Once you apply the filter you can use ->getColumnVal("Quantity");

It isn't a standard php function. It is a special webassist recordset function.

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

birdscreen398247

filterResults function

I just tried the following code and I get a syntax error message on the first line ("$rsWRSRoutes->filterResults([["RouteNumber","015"]]);").

<?php
$rsWRSRoutes->filterResults([["RouteNumber","015"]]);
$_SESSION["compilerID"] = $rsWRSRoutes->getColumnVal("Compiler");
?>

I do have rsobj.php linked to the page.

Where is the syntax wrong?

Sign in to reply to this post

Ray BorduinWebAssist

Is that the correct recordset name? $rsWRSRoutes

Please attach the page so I have some context otherwise I'm grasping at straws.

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

birdscreen398247

This is just a test page.

I am trying to figure out how to pick out a single record from a recordset without creating a new recordset.

In the sample case, I want to select a specific route number and display data from that record.

I will eventually have multiple routes to click on to display data from each one as a popup.

For now I just want to display on the screen the CompilerID just to show that I retrieved the correct data.

So I just need to get the syntax right.

The offending code is Line 49

Attached Files
TestCountyMap.php
Sign in to reply to this post

Ray BorduinWebAssist

You may just need:

php:
<?php

@session_start();
?>



after line 7.

If that doesn't work I'll probably need a URL and FTP access to fully debug.

Sign in to reply to this post
Did this help? Tips are appreciated...
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...