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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Inner Join displaying ID # not Name

Thread began 9/04/2010 9:11 pm by ken413883 | Last modified 9/05/2010 4:12 am by ken413883 | 486 views | 2 replies |

ken413883

Inner Join displaying ID # not Name

After days of '/facepalm headdesk' level of frustration, (and the help of Craig Rushforth...) I finally got the SELECT query working...now my issue is how the query results are displayed...

For example:

The insert and update forms use other tables as menu lists, and is set to save the ID# and display the NAME.

However, on the results and details pages, it shows me the ID# not the name.

The SELECT query now contains the appropriate INNER JOINS to gather the correct NAME data, but the screen only shows the numbers...

Can anyone tell me where to edit the result set so it shows menu1.menu_name, rather than form.menu1_id#?

Man I hope that made sense...

:-)

Sign in to reply to this post

Dave BuchholzBeta Tester

You need to specify the name that you want to display in your query so for example if you had two database tables one containing manufacturers and the other containing models linked by a foreign key in the models table the pseudo code would look like this:

SELECT manufacturersName, modelName, etc, etc 
FROM tbl_manufacturers
INNER JOIN tbl_models ON (tbl_manufacturers.id = tbl_models.foreignkey)



Does that help.

Sign in to reply to this post

ken413883

Fixed!!

The inner joins were working just fine, it was the display part that wasn't.

Got that fixed as well, and all is good.

The answer (for future help reasons...)

All it needs to know is the name of the recordset and the fields name.

So, for example, to display diety_name from your recordset WADAtoon, in the table from your example page, you need to do the following..

1. ensure diety_name is declared as an output field in your select statement
2. add the data to the (existing) repeated table.
If you wanted the column Diety Name in your table, immediately after Name: for example

On your page, you have a table tag, which looks something like

<table class="WADAResultsTable" border="0" cellpadding="0" cellspacing="0">

which contains the field headers.

<th class="WADAResultsTableHeader">Name:</th>
<th class="WADAResultsTableHeader">Class:</th>
<th class="WADAResultsTableHeader">Level:</th>

etc

Firstly, add a new tag like so

<th class="WADAResultsTableHeader">Name:</th>
<th class="WADAResultsTableHeader">Diety Name:</th>
<th class="WADAResultsTableHeader">Class:</th>
<th class="WADAResultsTableHeader">Level:</th>

Then, further down, you add a new row to the repeat region of the table, (within the do loop)

<td class="WADAResultsTableCell"><?php echo($row_WADAtoon['Toon_name']); ?></a></td>
<td class="WADAResultsTableCell"><?php echo($row_WADAtoon['diety_name']); ?></td>
<td class="WADAResultsTableCell"><?php echo($row_WADAtoon['Toon_class']); ?></td>
<td class="WADAResultsTableCell"><?php echo($row_WADAtoon['Toon_level']); ?></td>

(Make sure your field names are spelled correctly, and remember the code is case specific, so don't forget capital etters where appropriate.)

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