RE: Getting Results
| From: | Andrew Holt | Date: | Fri, 21 Jan 2011 10:48:17 +0000 |
| Subject: | RE: Getting Results | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-47644@lists.php.net to get a copy of this message | ||
Hi Karl,
What about:
$q = "SELECT username, userlevel, email, timestamp FROM Users_Table WHERE username IN (SELECT
username from VIP_Table) ORDER BY username ASC";
This performs a query on the VIP table to get the usernames and then gets the username, userlevel,
email and timestamp from the Users table if the username is in this result.
There are some tutorials which I often refer to when I need a refresh (not all programming in my job
unfortunately!):
http://www.tizag.com/mysqlTutorial/
http://www.w3schools.com/sql/default.asp
Hope this helps!
Andrew
-----Original Message-----
From: Karl DeSaulniers [mailto:karl@designdrumm.com]
Sent: 21 January 2011 01:02
To: php-db@lists.php.net
Subject: Getting Results
Hello,
Can anyone tell me if I am doing this right? Or how to do this right?
Not sure on what to search for. What the search term would be for
this type of call to the database.
$q = "SELECT username,userlevel,email,timestamp FROM ".USERS." ORDER
BY username FROM ".VIP." ";
I am basically trying to get a list of user info from the user table
based on the usernames that are in the vip table.
TIA,
Karl DeSaulniers
Design Drumm
http://designdrumm.com