close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Too many results returned once I add another table

Thread began 6/07/2011 1:33 pm by Jared Lui | Last modified 6/15/2011 8:34 am by Jared Lui | 3394 views | 18 replies

Jason ByrnesWebAssist

For 1, your query is not quite right, it should use a join syntax:


SELECT figure_lines.Line_Id, Line_Name, Line_Nickname, Start_Decade, End_Decade, Manufacturer, Size, Cat_1, Cat_2, Cat_3, figure_lines.Approved, Locked, figure_lines.Added_By, Line_Text, picture.Filename
FROM figure_lines
INNER JOIN picture ON figure_lines.Line_Id = picture_lines.Line_Id
ORDER BY Line_Name DESC

a record will be returned for each picture which is the cause of the problem you are having, in your recordset output code, you need to add some hand coding to only show the figure_lines information once.


The idea of the code is this:

just before the recordset loop, create a variable that is empty:
<?php $rsID = ""; ?>

around the code that will display the info from the figure_lines table add an if statement so it will only show if the $rsID is NOT equal to the current figure_lines.Line_Id

<?php if($rsID != $row_RecordsetName['Line_Id']) { ?>

<code to output the recordset info>

<?php } ?>

then set the $rsID to the current Line_Id:
<?php $rsID = $row_RecordsetName['Line_Id']; ?>


  I'd also like to be able to only have the picture row returned that has the thumbnail column marked. All suggestions are welcome. Thanks in advance.  




same type of if statement, i dont know how your 'marking' the thumbnail column so cant really say exactly what to use in the if statement, but the idea is:
<?php if($row_RecordsetName['Thumbnail'] == '1') {?>
show images
<?php } ?>

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