Jump to content

Red 09

Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling
  • Location
    Norway

Red 09's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Never mind, I figured it out: SELECT DISTINCT YEAR(date) FROM articles GROUP BY date; PS! It seems that YEAR() is case-sensitive. year(date) != YEAR(date) for some reason
  2. This is for a simple news archive. I need help with a way to make a list like this: 2000 2001 2002 2003 (etc..) Clicking on a year will display all entries posted that year. The yearlist is to be extracted from news entries in a table, and each year is to occur only once in the list. Could someone please help me out?
  3. I\'m trying to make a \'most recent entries\' list for my intranet site. I want his list to show the last 10 entries from 3 or more tables. I only want it to show entries the user has access to (I use a very simple function to check the users access level in the category for each entry). I can\'t figure out how to make a mysql query that returns certain fields from the 3 or more tables, and sorts them after the \'date published\'-field in each table, and filters out expired items based on the \'expire date\'-field (the names of these fields are not the same in all the tables). If I can get this far, I\'m going to try and make a loop in php that checks the users access against each entry in the result untill 10 are found. Can anyone help?
  4. Thanks for the replies. What I\'m trying to do is to make a intranet site that holds different kinds of data (articles, calenders, contact lists, image galleries, etc) in different tables. I have a crude system with main categories and sub categories. the reason I want to have unique id\'s is so I can mix entries from different tables in the sub categories. Example: Category B, has a sub category K. Inside sub categroy K I want to place 3 articles, and 1 contact list. I want to be able to sort these by alphabet or date as if they were all entries from the same table. I\'m not sure I understood what nabeel21 meant, but I\'ll look into it. I\'ll probably figure it out somehow, but I\'m not sure if It would be the best solution I want to give the users full ability to create categories, subcategories and put entries in these from the different tables I mentioned (articles, etc..).
  5. My current solution is a table i call index (the parent?), wich holds a field for unique id and a reference to a unique entry in another table (the child?). Does mySQL have a built-in better way to \"share\" id sequences? Example: I make an entry into TableA and it gets id 1, the next two entries are in TableB and gets id 2 and 3, I add one more entry to TableA again and this gets id 4... and so on.
×
×
  • 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.