View Single Post
Old 10-04-2008, 06:29   #1 (permalink)
Encantado
Creativo
 
Encantado's Avatar
 
Join Date: Nov 2006
Location: Torrevieja (Alicante), Spain
Posts: 9
SQL problem: Select from multiple tables

Hi all,
I've got a question and hope that somebody can help me with it

The Tables:

Table A : Saunas
- field: id
- field: name
- field: visible

Table B : Spas
- field: id
- field: name
- field: visible

The Question:
How do I select in 1 query every product that has visible = 1.
So I need to display all the Saunas and all the Spas which are visible. These table are not linked with each other.

I have been trying queries like :

SELECT saunas. * , spa_jacuzzis. * FROM saunas, spa_jacuzzis
WHERE saunas.special_offer = '1' AND spa_jacuzzis.special_offer = '1'

But it only shows me the visible saunas

Some help would be great!
  Reply With Quote