Re: SELECT giving too much :)

From: Date: Thu, 30 Aug 2001 04:31:02 +0000
Subject: Re: SELECT giving too much :)
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11979@lists.php.net to get a copy of this message
Hi Beau-- This is just a wild guess (I've only glanced at your SQL), but do you have two locations in your locations table? You might want to try yanking locations out of the join since you're not using it in your WHERE clause or showing any info from it. Doug At 12:06 PM 8/30/01 +0800, Beau Lebens wrote: >Hi guys, I have a set-up to query a database by allowing the user to build a >query from selecting fields, restrictions etc etc. > >It produces the following; > >SELECT students.fname, courses.title AS course FROM students, courses, >course_enrolments, groups, locations, staff WHERE >(students.studentID=course_enrolments.studentID AND >course_enrolments.courseID=courses.courseID) AND >(students.groupID=groups.groupID) AND (staff.staffID=courses.staffID) ORDER >BY fname ASC [--snip--] --Doug's Signature File---------------------------------------- ~ ~ ~ I'm proud to work for GLISnet, Michigan's best ISP ~ ~ ~ --1.888.445.4763---8am to 8pm every day---http://www.glis.net-- The views and opinions expressed in this email are my own and may not be those of my employer.

« previous php.db (#11979) next »