Need Assistance on a Complex MySQL Query
I'm currently improving a site of mine called Commenty, and need some help with a large SQL query:
I need to display comments about the user based on a few working combinations of info:
- First Name & Last Name
- CID (unique Commenty ID #)
- Email Address
- Street & City & State & Zip Code
- AIM Handle
If any one of these either/or/and criteria are met, then it can display that comment, because it is enough to (99%+ most likely) identify a single person. My goal with this is to keep the comments private; and to only be read by the intended recipient.
However, I am having cases where other people's comments are being shown to the wrong recipient; and I'm sure it has to do with this SQL query. My emergency comment privacy buffer is catching all comments with unintended recipients and hiding the comments to maintain privacy; however, I really need to get this fixed.
I'm not getting any MySQL errors... so...
Any help appreciated. Thanks! :wave:
.chulium.
I'm currently improving a site of mine called Commenty, and need some help with a large SQL query:
PHP:
$bigq = mysql_query("SELECT * FROM tablename WHERE fname='$fname' AND lname='$lname' OR cid='$cid' OR email='$email' OR street='$address' AND city='$city' AND state='$state' AND zip='$zip' OR aim='$aim' ORDER BY id DESC LIMIT 50") or die(mysql_error());
I need to display comments about the user based on a few working combinations of info:
- First Name & Last Name
- CID (unique Commenty ID #)
- Email Address
- Street & City & State & Zip Code
- AIM Handle
If any one of these either/or/and criteria are met, then it can display that comment, because it is enough to (99%+ most likely) identify a single person. My goal with this is to keep the comments private; and to only be read by the intended recipient.
However, I am having cases where other people's comments are being shown to the wrong recipient; and I'm sure it has to do with this SQL query. My emergency comment privacy buffer is catching all comments with unintended recipients and hiding the comments to maintain privacy; however, I really need to get this fixed.
I'm not getting any MySQL errors... so...
Any help appreciated. Thanks! :wave:
.chulium.




