RE: Getting Results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx] 
Sent: 21 January 2011 01:02
To: php-db@xxxxxxxxxxxxx
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


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux