close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Show Region (Recordset) Not working

Thread began 1/08/2010 1:10 am by jo4koalas392067 | Last modified 1/08/2010 10:08 pm by jo4koalas392067 | 1789 views | 2 replies |

jo4koalas392067

Show Region (Recordset) Not working

I am pulling my hair out on this one and I am sure it is something simple, but just can't see it. I have added some Show If.. regions based on a recordset, but I cannot get it to display properly. I have attached a copy of my file, but the following are examples of the live results which as you can see don't work:

1) occupation_Detail.php?record_id=10 This should show under State/Territory Sponsorship Details: "No Sponsorships Currently Available" as the recordset is empty - but as you can see it doesn't and still shows the headers.

2) occupation_Detail.php?record_id=9 This is what is looks like when there is Data in the recordset - which is correct.

Hope you someone can see where I have gone wrong.

Jo

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

Jason ByrnesWebAssist

The problem is in the way you are creating your recordset, specifically the joins you are using.

have a look at the following for a good description the different joins that are available:
sql_join.asp

  Different SQL JOINs

Before we continue with examples, we will list the types of JOIN you can use, and the differences between them.

* JOIN: Return rows when there is at least one match in both tables
* LEFT JOIN: Return all rows from the left table, even if there are no matches in the right table
* RIGHT JOIN: Return all rows from the right table, even if there are no matches in the left table
* FULL JOIN: Return rows when there is a match in one of the tables  




Where you are using left joins in the query, it will still return data from the left tabel, even if there is match found on the right table,

because of this, the recordset is not empty, just the columns you are trying to output.

to double check this, take the query into the MySQL Querybrowser and run it there so you can see exactly what is being returned. The query being run is:

SELECT occupation.ASCOid     , asco.ASCO     , asco.maindesciption     , state.StateID, state.StateDescription     , stateoccvisajoin.StateOccVisaID     , stateoccvisajoin.V176     , stateoccvisajoin.V886     , stateoccvisajoin.V475     , stateoccvisajoin.V487 FROM Data4ma.asco     INNER JOIN Data4ma.occupation          ON (asco.AscoASCOid = occupation.ASCOid)     LEFT JOIN Data4ma.stateoccvisajoin          ON (stateoccvisajoin.SOVOccupationID = occupation.record_id)     LEFT JOIN Data4ma.state          ON (stateoccvisajoin.SOVStateID = state.StateID) WHERE occupation.record_id = 10 ORDER BY state.StateDescription ASC




Play around with the different join types in the MySQL Querybrowser to see how the effect the results you get.

Sign in to reply to this post

jo4koalas392067

Hi Jason

Thank you so much. Yes it was the joins. Have amended it and now works.

Thanks again

Jo

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