You are here: How to get a part of the SELECT results « PHP SQL « IT news, forums, messages
How to get a part of the SELECT results

Posted by dutch disCo on 10/13/71 11:47

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация