Use a join on the same table, something like:
SELECT tbl1.*, tbl2.* FROM table_name AS tbl1 INNER JOIN table_name AS tbl2 ON tbl1.a=tble2.b
Not tested and a quick example
simplypixie
Practically a Master Poster
642 posts since Oct 2010
Reputation Points: 157
Solved Threads: 118
Skill Endorsements: 5
When you say 'row' - do you mean 'column' (field)?
diafol
Keep Smiling
10,826 posts since Oct 2006
Reputation Points: 1,675
Solved Threads: 1,532
Skill Endorsements: 61
Most simple queries will give something like this:
A B
1 0
2 1
If you use an UNION or an OR operator in the WHERE clause. BUt you say that you want a single row:
A B
1 1
Perhaps something like this - but there may be an easier way:
(SELECT A, B FROM AB WHERE A = 1 LIMIT 1) UNION (SELECT A,B FROM AB WHERE B = 1 LIMIT 1)
If mysql_num_rows == 2 then you've got a match. It won't give the query result as a single row though.
diafol
Keep Smiling
10,826 posts since Oct 2006
Reputation Points: 1,675
Solved Threads: 1,532
Skill Endorsements: 61