close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Showing value for menulist instead of ID?

Thread began 12/19/2011 6:32 am by steelace396915 | Last modified 12/19/2011 5:56 pm by Ian S | 535 views | 3 replies |

steelace396915

Showing value for menulist instead of ID?

Hi

Ive built a set of dataassit wizard pages. I have 2 tables in my database, one for items and one for itemstypes. In my items table I have a foreign key field (itemtypeID) linking the itemtype table with the main item tabel. So far so good.

On the wizard insertpage I have formatted the linked itemtypeID field to show a menulist of the values from the itemtype table. This works good and I can choose value (itemtype) and its inserted correctly in database. Its ID is inserted in the foreign key field (itemtypeID) in the items table.

On the Results and Details pages from the wizard I would like to show the value for that field instead of the ID!? How can I accomplish this? Probably very simple but I'm new to this!
Hope somebody has a simple explanation! ;=)

Regards,
Martin J.

Sign in to reply to this post

Ian S

Hi Martin,

You need to create a Dreamweaver recordset with a SQL Join so that you join the two tables together.

e.g.

SELECT
FROM table1 INNER JOIN table2 ON table2.idcolumn = table1.idcolumn

Then you can simply use the bindings and drag across the text value that is associated with the id for that record.

Cheers
Ian

Sign in to reply to this post

steelace396915

Thanks for answer Ian! I need some more help I think because I'm a real newbie to this!
I tried the SQL command you gave me and it almost works. The problem is that when I insert a new record and choose an option in the menulist it comes back with another option from the list in the results page!?

I have 1 main table named "media" and 1 table named "mediatype".

In the main table I have a bunch of fields including INT primary key field plus an INT field named "MediaAccessLevelsID" as foreign key field. In the mediatypes table I have 2 fields, 1 INT field (primary key) named "MediaTypeID" and 1 VARCHAR named "MediaTypeName".

I tried to create a recordset named rsJoin and the following SQL command:

SELECT *
FROM media INNER JOIN mediatype ON mediatype.MediaTypeID = media.MediaID

What am I doing wrong?

Regards,
Martin J

Sign in to reply to this post

Ian S

Hi Martin,

It sounds like you are pretty much there.

First thing I would always check is that the correct value you are expecting is being stored in the media table. If its not storing correctly then there is an issue with the way the insert page is working.

Then, what is your results page? Is it just displaying the record information or is it an 'edit' page.

If the wrong value is being retrieved is there any pattern to it (i.e. is it the same incorrect value or is it random?)

Cheers
Ian

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