Re: INNER JOIN

From: Date: Wed, 22 Nov 2000 22:14:02 +0000
Subject: Re: INNER JOIN
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-26741@lists.php.net to get a copy of this message
On Wed, 22 Nov 2000, Jeremy wrote: > Is this proper syntax for MySQL? > > For some reason, it is not returning results > > if (!($result = mysql_query("SELECT comments.tabid, avg(comments.rating) as rating, > tabs.band, > tabs.song FROM comments, tabs WHERE comments.tabid = tabs.id AND rating <> > 'none' AND tabs.instrument = '$instrument' > GROUP BY comments.tabid > ORDER BY rating DESC > "))) { > echo("Fail"); > } > Some quick questions: 1) Does the query work when entered interactively? 2) Does it work if you precede 'rating' by 'comments.' in all places (except after 'as', of course)? -- Ignacio Vazquez-Abrams <ignacio@openservices.net>

« previous php.general (#26741) next »