Results 1 to 2 of 2

Thread: MySQL result set...but from which table?

  1. #1
    Join Date
    Feb 2008
    Location
    Coventry
    Posts
    103
    Thanks
    5
    Thanked 8 Times in 8 Posts

    Question MySQL result set...but from which table?

    Hi Guys,

    this is a tricky one really.

    so my quandary is that i have 2 tables that are not related but i want to get the 3 most recent entries from them.
    so a result set could consist of:
    1 result from table1
    2 results from table2

    or a result set could consist of:
    2 results from table1
    1 result from table2

    and there are other patterns of results obviously.

    Anyway this would make the 3 most recent entries that i want to achieve.
    This is fine doing a join but my problem is when i want to kick out the results to the user & they need a link to a particular page.

    For example
    results from table1 would need to go to page1.php
    results from table2 would need to go to page2.php

    how do i differentiate which table the row from the result set came from?

    I'm stuck on what to put into google really. If anyone knows a solution i would be very grateful!

    Cheers
    The important thing is not to stop questioning. Curiosity has its own reason for existing.

  2. #2
    Join Date
    Feb 2008
    Location
    Coventry
    Posts
    103
    Thanks
    5
    Thanked 8 Times in 8 Posts

    Default

    OK i figured it out (found it really).

    For those who might find this later go to this page

    http://lists.mysql.com/mysql/211371

    hopefully that will answer any questions, but for now i'm a happy guy again :P

    cheers guys & sorry for wasting your time!
    The important thing is not to stop questioning. Curiosity has its own reason for existing.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •