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 interpret

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

2002-03-21 Thread Laurie Landry
I'm working on a query by selection type of form, where if a user selects a subject to get information. Each database entry will have 2 subject fields, Subject 1 being the main subject and Subject 2 being the cross-subject. A table is set up like this: +--+--+--+--+---

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

2002-03-14 Thread Martin Towell
t: Friday, March 15, 2002 2:55 PM 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 w

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

2002-03-14 Thread phplist
Thursday, March 14, 2002 7:42 PM > To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] > Subject: RE: [PHP] Fetching 1 array from either one of 2 > possible columns? > > > use brackets > > where (sub1 or sub2) and geo > > -Original Message----- > From: phplis

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

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

2002-03-14 Thread phplist
I'm working on a query by selection type of form, where if a user selects a subject to get information. Each database entry will have 2 subject fields, Subject 1 being the main subject and Subject 2 being the cross-subject. A table is set up like this: +--+--+--+--+---