Web Hosting Talk







View Full Version : PHP/mySQL duplicate outputs


crEA-tEch
03-22-2004, 06:51 PM
Hey guys...

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

SELECT b.*, c.* FROM tod_company_information c, tod_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

OIS
03-22-2004, 07:32 PM
Try this:

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

robeyh
03-23-2004, 12:21 AM
yep, you had one of the tables in your query twice. That would cause it to duplicate entries.

crEA-tEch
03-23-2004, 04:33 PM
Thanks guys :), it worked

I appreciate the help

crE