How to get a part of the SELECT results

Hi,

I have two tables that relate to each other by users ids. I want to
fetch a fow as follows:

SELECT user_id,username,homedir FROM users,ftpusers WHERE user_id=id AND
username='zdzisio';

But instead of getting this:

+---------+------------------+--------------------+
| user_id | username | homedir |
+---------+------------------+--------------------+
| 11 | zdzisio | /home/zdzisio/ |
+---------+------------------+--------------------+


I want to get something like this:

+--------------------+
| homedir |
+--------------------+
| /home/zdzisio/ |
+--------------------+


In other words: I want to select all three fields from both tables but
display only one of them.

How to do that?

Any help appreciated
Respect
dd
dutch disCo [ Do, 11 Mai 2006 21:17 ] [ ID #1311121 ]

Re: How to get a part of the SELECT results

SELECT homedir FROM users,ftpusers WHERE user_id=id AND
username='zdzisio';
zac.carey [ Fr, 12 Mai 2006 00:32 ] [ ID #1311123 ]
PHP » alt.php.sql » How to get a part of the SELECT results

Vorheriges Thema: Redirect
Nächstes Thema: Simple Optimization for PHP and MySQL