Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Help with advanced MySQL query, possibly left/right join.


Message #1 by "Bill Bob" <bige88fan@c...> on Thu, 10 Oct 2002 21:21:42
Thanks.  I noticed my mistake, but only after I'd sent it to the list.  Here
is a question for you and everyone in the in the list:

Where should I go to find a good tutorial describing the efficient use of
SESSION variables and security in general?
I have a security problem with a site I'm working on:
http://www.healthyproductsplus.com/cust/login.php





THIS E-MAIL MESSAGE AND ALL ATTACHMENTS TRANSMITTED HEREWITH ARE TRADE
SECRET AND/OR CONFIDENTIAL INFORMATION INTENDED ONLY FOR THE VIEWING AND
USE OF ADDRESSEE.  IF THE READER OF THIS MESSAGE IS NOT THE INTENDED
RECIPIENT, YOU ARE HEREBY NOTIFIED THAT ANY REVIEW, USE, COMMUNICATION,
DISSEMINATION, DISTRIBUTION OR COPYING OF THIS COMMUNICATION IS PROHIBITED.
IF YOU HAVE RECEIVED THIS COMMUNICATION IN ERROR, PLEASE NOTIFY THE SENDER
IMMEDIATELY BY TELEPHONE OR ELECTRONIC MAIL, AND DELETE THIS MESSAGE AND
ALL COPIES AND BACKUPS THEREOF.  THANK YOU FOR YOUR COOPERATION.

-----Original Message-----
From: Nikolai Devereaux <yomama@u...>
To: professional php <pro_php@p...>
Date: Friday, October 11, 2002 11:13 AM
Subject: [pro_php] Re: Help with advanced MySQL query, possibly left/right
join.


>
>Hey Darrian,
>
>
>I'd recommend against using a LEFT join.  Left and right joins will return
rows
>that do not necessarily have a matching column value in both tables.
>
>an INNER JOIN would be a better.
>
>Also, the syntax of your join expression seems a little off.  You're not
>joining on catname, you're joining on headingid.
>
>This should work out better:
>
>SELECT catname
>  FROM categories
> INNER JOIN cat_headings ON
>       categories.headingid = cat_headings.headingid
>
>
>Your left join was:
>
>
>SELECT catname
>  FROM categories
>  left join <the other table name> on catname
>
>  WHERE categories.headingid = h.headingid AND title = '$parent'");
>
>
>That should throw an SQL parser error because there's not a valid
comparison in
>the ON clause of the JOIN expression.  You're still specifying the relation
>between the columns in the WHERE clause, not in the JOIN.
>
>
>take care,
>
>nik
>
>
>
>


  Return to Index