Jump to content

DW recordset to pull 1 record from DB based on date


T2theC

Recommended Posts

Hi guys,

 

I am a novice coder... So be gentle!

 

I am using DW to pull information from my DB about magazines. I have on table that has all the general info about the mag in it, and another table with all the latest issue info in it.

 

I have created a 'Master-Detail' page that pulls ALL the information. What I want is to pull just one magazine title and the latest issue information.

 

So I will have a repeating region like this:

 

MainInfo.Title

MainInfo.Description

 

LatestIssue.IssueNumber

LatestIssue.WhatsInIt

 

 

At the moment I am getting ALL the records showing for that magazine title.

 

Help for a newbie? (Please feel free to talk to me like an idiot!)

 

Thanks in advance

 

Link to comment
Share on other sites

I am a novice coder... So be gentle!

We are a help forum, so we are always gentle unless you ask us things that are already covered in the manual because those who wrote it deserve the respect.

 

Add this to your query:

LIMIT 1

 

Please feel free to talk to me like an idiot

I'm in a good mood today ;)

Link to comment
Share on other sites

ha ha, Thanks for the fast reply.

 

I have just tried that and it worked... But not as I need it to.  :(

 

I probably didn't explain myself very clearly... So here is take two...

 

There will be several different magazines in

MainInfo.Title

MainInfo.Description

 

So there might be one called: SportsMag and another called ShoppingMag. Each with a latest issue. I want to display:

 

SportsMag                                              <<<<-These two coming from MainInfo Table

SportsMag.Description

 

SportsMag.LatestIssue.IssueNumber        <<<<-These two coming from LatestIssue Table

SportsMag.LatestIssue.WhatsInIt

 

-------------------------------------

 

ShoppingMag

ShoppingMag.Description

 

ShoppingMag.LatestIssue.IssueNumber

ShoppingMag.LatestIssue.WhatsInIt

 

 

I have a date column in both tables so that the datestamp is put in. So I need either the SQL or PHP to pull ONLY one entry of each:

MainInfo.Title

MainInfo.Description

 

and then the latest issue info for that title.

 

I hope this has help. And thanks again for pitching in!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.