Results 1 to 4 of 4
Thread: PHP/mySQL duplicate outputs
-
03-22-2004, 06:51 PM #1Junior Guru
- 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 c, tod_bookings b INNER JOIN tod_bookings ON c.company_id = b.company_id ORDER BY b.date_in ASC
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. >>>
-
03-22-2004, 07:32 PM #2Junior Guru Wannabe
- Join Date
- Feb 2004
- Posts
- 76
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
Matthew Williams
Centerdesk, LLC • Web Hosting, Domain Registration, Custom Shopping Carts
http://www.centerdesk.com
1-888-647-3282, ext. 650
-
03-23-2004, 12:21 AM #3Disabled
- 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.
-
03-23-2004, 04:33 PM #4Junior Guru
- 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. >>>