close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Advanced recordset question

Thread began 9/06/2016 10:43 pm by GaryMorris | Last modified 9/07/2016 2:12 pm by Ray Borduin | 291 views | 1 replies |

GaryMorris

Advanced recordset question

I am working on a entertainment website that has 2 tables, performerstbl which has perfID and performer columns.
The other table is an events table. It has all the info regarding the event. Date time, performer, performer bio, etc...
Works perfectly with one performer. Use and INNER JOIN to get info that I need between the 2 tables.

What I am trying to do is add a second performer on the public events page on any given date(needed very rarely).
On the addevent page I added a second menu to choose a performer. It dynamically pulls the names from the performertbl. That part works great.

I am trying to figure out how to use the perfID/performer name that the second menu generates to populate a seperate field. The problem is I have tried an INNER JOIN but got lost in the process.
Here is the existing recordset that works fine with one performer.

SELECT eventtbl.*, performertbl.firstname, weekdaytbl.weekday
FROM eventtbl INNER JOIN performertbl ON eventtbl.perfID = performertbl.perfID INNER JOIN weekdaytbl ON eventtbl.weekdayID = weekdaytbl.weekdayID
ORDER BY eventtbl.`date` LIMIT 50

I setup a perf2ID in the event table but realized the problem was going to be that 'performertbl.firstname' which is the name field is already being used..
Confusing but if you have ANY ideas I would appreciate help.
Thanks.

Sign in to reply to this post

Ray BorduinWebAssist

SELECT eventtbl.*, performertbl.firstname, weekdaytbl.weekday, performer2.firstname AS perf2firstname
FROM eventtbl INNER JOIN performertbl ON eventtbl.perfID = performertbl.perfID LEFT OUTER JOIN performertbl AS performer2 ON eventtbl.perf2ID = performer2.perfID INNER JOIN weekdaytbl ON eventtbl.weekdayID = weekdaytbl.weekdayID
ORDER BY eventtbl.`date` LIMIT 50
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...