close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Display data from related tables in results

Thread began 4/30/2009 11:48 am by phil.evans372967 | Last modified 8/27/2010 12:04 pm by phil.evans372967 | 8925 views | 16 replies

phil.evans372967

I've adapted my query further which now pulls out all the right results, but only displays the first image associated with the property record

SELECT prop_details.prop_id, prop_details.prop_ref, prop_details.short_desc, prop_images.img_thumb, prop_images.prop_id, prop_details.long_desc
FROM prop_details LEFT JOIN prop_images ON prop_details.prop_id=prop_images.prop_id
GROUP BY prop_images.prop_id, prop_details.prop_id
ORDER BY prop_details.prop_ref

Can anyone guide me as to how to adapt my PHP block to acheive this?

This is what I've got so far

<body>
<table width="80%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td>Prop ID From Ims Table</td>
<td>Prop ID from Deatils table</td>
<td>Office Ref</td>
<td>Short Desc</td>
<td>Long Desc</td>
<td>Thumbs</td>
</tr>
<?php do { ?>
<tr>
<td align="left" valign="top"><?php echo $row_Recordset1['prop_id']; ?></td>
<td align="left" valign="top"><?php echo $row_Recordset1['prop_id']; ?></td>
<td align="left" valign="top"><?php echo $row_Recordset1['prop_ref']; ?></td>
<td align="left" valign="top"><?php echo $row_Recordset1['short_desc']; ?></td>
<td align="left" valign="top"><?php echo $row_Recordset1['long_desc']; ?></td>
<td align="left" valign="top"><img src="../images/tns/<?php echo $row_Recordset1['img_thumb']; ?>" width="50" height="50" alt="" /></td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>

With thanks as ever

Phil

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