Re: Re: Retrieve information from mutiple tables
| From: | Prodoc | Date: | Mon, 22 Apr 2002 08:04:12 +0000 |
| Subject: | Re: Re: Retrieve information from mutiple tables | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18714@lists.php.net to get a copy of this message | ||
It's a no go...
This is what I tryed:
"SELECT User.NickName FROM User, Rights WHERE (User.UserID = Rights.UserID && (Rights.MainID = ${row['MainID']} || ISNULL(Rights.MainID))"
The only thing I want to be able to retrieve is a list of nicknames (User.NickName) based on MainID. In the Rights Table the MainID value has to be NULL or = ${row['MainID']}
Jason Wong wrote:
On Monday 22 April 2002 00:53, Prodoc wrote:E.g. I've got two tables (User and Rights) both contianing UserID, I want to retrieve some UserID's from the Rights table and use those UserID's the get the nickname of those users from the User table. ("SELECT UserID FROM Rights WHERE...........") ("SELECT NickName FROM User WHERE...........") Is it possible to combine those two statements?Try: SELECT Rights.UserID, User.NickName FROM Rights, User WHERE User.UserID = Rights.UserID