Re: loading data from database

From: Date: Mon, 11 Apr 2005 06:33:40 +0000
Subject: Re: loading data from database
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-212786@lists.php.net to get a copy of this message
Micha Biegnolé wrote:
Hi, I am a student of multimedia design. I have two tables in a database with one same column(column:Name). I ask data from table1 collumn:Name. In table2 I want to use the return of data from table1 and search table2 collumn:Name for other information. I tried joined SELECT, but it didn't work with me. I hope someone understands what I mean, my english is not so great. select data from table1. SELECT name FROM table1 WHERE movies='yes' Then I want to select from table2 using the result of select from table1. SELECT * WHERE..?
If your MySQL server support sub-selects, then you can simply do : SELECT * FROM table2 WHERE column IN (SELECT name FROM table1 WHERE movies = 'yes')

« previous php.general (#212786) next »