Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Location
    Walsall - UK
    Posts
    177

    PHP/mySQL duplicate outputs

    Hey guys...

    I'm having a little trouble with this mySQL query I got help with a week or so ago on this forum

    PHP Code:
    SELECT b.*, c.* FROM tod_company_information ctod_bookings b INNER JOIN tod_bookings ON c.company_id b.company_id ORDER BY b.date_in ASC 
    I'm getting duplicates of the same entry... and when there are more entries to be displayed - i get even more duplicates of the same entry....

    http://www.eeeep.com/misc/tt-3.jpg

    I dont understand whats happening... I know its something to do with the query.. because when i use a much simpler query, i just get the expected 1 output from each individual record...

    Does anyone have any idea why its doing this?

    Thanks in advance

    crE
    <<< Please see Forum Guidelines for signature setup. >>>

  2. #2
    Try this:

    Code:
    SELECT b.*, c.* FROM tod_company_information c INNER JOIN tod_bookings b ON c.company_id = b.company_id ORDER BY b.date_in ASC

  3. #3
    Join Date
    Mar 2004
    Location
    Granville OH
    Posts
    108
    yep, you had one of the tables in your query twice. That would cause it to duplicate entries.

  4. #4
    Join Date
    Aug 2003
    Location
    Walsall - UK
    Posts
    177
    Thanks guys , it worked

    I appreciate the help

    crE
    <<< Please see Forum Guidelines for signature setup. >>>

Posting Permissions

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