T2theC Posted July 10, 2009 Share Posted July 10, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/165474-dw-recordset-to-pull-1-record-from-db-based-on-date/ Share on other sites More sharing options...
ignace Posted July 10, 2009 Share Posted July 10, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/165474-dw-recordset-to-pull-1-record-from-db-based-on-date/#findComment-872747 Share on other sites More sharing options...
T2theC Posted July 10, 2009 Author Share Posted July 10, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/165474-dw-recordset-to-pull-1-record-from-db-based-on-date/#findComment-872769 Share on other sites More sharing options...
ignace Posted July 10, 2009 Share Posted July 10, 2009 Please provide a short summary (table names + columns) of all relevant tables Quote Link to comment https://forums.phpfreaks.com/topic/165474-dw-recordset-to-pull-1-record-from-db-based-on-date/#findComment-872798 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.