Sampson, Peter wrote:
> Gabriel.
> 
> This works fine and the two tables talk to each other.
> 
> BUT,
> My website can have 5 - 10 news stories per month. So in the tblNews I
> could have
> 


[Snip multiple rows]

> I need to use DISTINCT in the SQL lingo as I "bind" the recordset's
> "nMonth" to a dropdown list. I only require one instance of each
> "nMonth". So that a visitor can select a month from a drop down and past
> the months name into a detail page that shows all records.

All, but for a drop-down of months, you've already got that -- the 
MonthNames table (or just do it programmatically).

"SELECT mName, nMonth FROM MonthNames ORDER BY nMonth" would give you a 
happy list of months, and their index for the tblNews table.

Then finding all the stories for a given month is easy -

let $month be what was returned from the form,
and "SELECT Story, date, etc-other fields FROM tblNews WHERE
        nMonth = $month "



> For example a visitor will click on
> 
> February and be taken to a page that shows 4 records from above table.
> 
> I have performed a similar fuction on this site:
> http://www.norfolk.gov.uk/jubilee/
> 
> with towns. Towns are easy because they can be stored alphabetically,
> months need to retain their chronological order.



You may just want to use the date field type.   That might be easier
for you, expecially if you want to be able to select stories from a 
given year and month, as apposed to just a month.





-- 
Gabriel Cain                            
Unix Systems Administrator           [EMAIL PROTECTED]
Dialup USA, Inc.                      888-460-2286 ext 208


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to