Re: [PHP] Fetching 1 array from either one of 2 possible columns?

2002-03-21 Thread Thalis A. Kalfigopoulos
The problem is in your SQL query. Try it as: $sql = SELECT * FROM links WHERE (SUBJECT1='$subject' OR SUBJECT2='$subject') AND GEOGRAPHIC='$geographic' ORDER BY ORGANIZATION ASC; The AND operator has higher precendence than the OR, so given that you didn't have parenthesis, it was

RE: [PHP] Fetching 1 array from either one of 2 possible columns?

2002-03-14 Thread Martin Towell
use brackets where (sub1 or sub2) and geo -Original Message- From: phplist [mailto:[EMAIL PROTECTED]] Sent: Friday, March 15, 2002 2:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Fetching 1 array from either one of 2 possible columns? I'm working on a query by selection type of form,

RE: [PHP] Fetching 1 array from either one of 2 possible columns?

2002-03-14 Thread phplist
]; $esc_subject = $row[SUBJECT1]; $esc_geographic = $row[GEOGRAPHIC]; -Original Message- From: Martin Towell [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 14, 2002 7:42 PM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: [PHP] Fetching 1 array from either one of 2 possible

RE: [PHP] Fetching 1 array from either one of 2 possible columns?

2002-03-14 Thread Martin Towell
To: 'Martin Towell'; [EMAIL PROTECTED] Subject: RE: [PHP] Fetching 1 array from either one of 2 possible columns? I apologize if I wasn't clear in my email. The query part is fine I think, as I tested it through the myPHPAdmin and had no problem with the results (but brackets are good though). It's