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

 

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 ;)

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!

Archived

This topic is now archived and is closed to further replies.

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