close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Some advice needed for Data Bridge

Thread began 10/26/2012 10:23 am by mrs | Last modified 10/26/2012 10:32 pm by Jason Byrnes | 417 views | 3 replies |

mrs

Some advice needed for Data Bridge

I saw a tutorial from WA with regards to joining the contents of a database, but I can't for the life of me find it now, and apart from being different subject matter, it looked to achieve exactly what I need.

I have a page with a master recordset and a child recordset. This master recordset will hold the unique IDs to return content for related child recordset. This related content is in another DB table, and it is a table with five or six promotional records in it; the administrator can choose to apply a promotion to multiple records from the master table.

So, I am trying to achieve this:

Pull in content to a page from a master record which in turn triggers the content for the child record which is the promotional content. This master record has loads of columns, one of which holds the unique ID of the related promotion.

Now, if I structure my SQL like this, it only returns the first promo record from the results regardless of the promo ID entered into the master record column:

Name: promovar
Type: INT
Default value: -1
Runtime value: $_GET['tbl_master.fld_promoRELATED']

SELECT * FROM tbl_promo JOIN tbl_master ON tbl_master.fld_promoRELATED = tbl_promo.fld_promoID WHERE tbl_master.fld_promoRELATED = promovar

If I use a default value of 3 for example, then the promo record with ID 3 is returned. Basically, the results aren't displaying dynamically. The info in the master record is effectively being ignored. Somewhere a variable is missing that should match that of the master record in order to return the promo record, and it's here that I am stuck :(

Does this make sense? If so, how can I achieve this with Data Bridge?

Thanks.

Mat

Sign in to reply to this post

Jason ByrnesWebAssist

i think the tutorial you are thinking of is the "Displaying Relational Tables with Plug-ins" tutorial on the data bridge page:

data-bridge/

how are the links created?


tbl_master.fld_promoRELATED doesn't look like a valid url variable name to me.

Sign in to reply to this post

mrs

Ah right, I am trying to get it to look straight at the contents of the column within the master recordset / DB table rather than some session or URL variable.

I was assuming that if I ordered the code so that the master recordset came first, followed by any child recordsets, I could take the values in the promo column and join it to the unique ID of the promotional content table.

Is it not possible to get it to look straight at the contents of a table? Is that what I am doing wrong? I've tried to build this manually, and I must admit, it has taken quite a while to get where I am just for it to not work properly, and I assumed that Data Assist and other tools from Data Bridge would enable me to achieve this quicker and successfully.

Sign in to reply to this post

Jason ByrnesWebAssist

Originally Said By: mrs
  Is it not possible to get it to look straight at the contents of a table?  



Well, then dont use a where clause.


the ON section of your query:
SELECT * FROM tbl_promo JOIN tbl_master ON tbl_master.fld_promoRELATED = tbl_promo.fld_promoID


tells it to compare the tbl_master.fld_promoRELATED column with the tbl_promo.fld_promoID column and return results where they are equal



by adding the where clause:
WHERE tbl_master.fld_promoRELATED = promovar

and using a GET variables, you are telling it to restrinct the returned results to only where the tbl_master.fld_promoRELATED column is equal to the URL being used.

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