Re: [PHP-DB] Re: Getting Results

2011-01-21 Thread Richard Quadling
On 21 January 2011 12:39, Karl DeSaulniers wrote: > Very informative, > Thank you Richard. > > I will have to flag this one and come back to it. > My database structure may require something of this measure down the line > with the auditing ability I plan on building into the admin section. > > Ne

Re: [PHP-DB] Re: Getting Results

2011-01-21 Thread Karl DeSaulniers
Very informative, Thank you Richard. I will have to flag this one and come back to it. My database structure may require something of this measure down the line with the auditing ability I plan on building into the admin section. Never heard of USE AdventureWorks. Is that a SQL system functio

Re: [PHP-DB] Re: Getting Results

2011-01-21 Thread Karl DeSaulniers
Ahh yes, I remember that now. Thank you. Karl On Jan 21, 2011, at 6:17 AM, Richard Quadling wrote: On 21 January 2011 11:58, Karl DeSaulniers wrote: So to do descending order I'd put DES or DEC? Just curious about that one. ASC and DESC -- Richard Quadling Twitter : EE : Zend @RQuadli

Re: [PHP-DB] Re: Getting Results

2011-01-21 Thread Richard Quadling
On 21 January 2011 11:58, Karl DeSaulniers wrote: > So to do descending order I'd put DES or DEC? Just curious about that one. ASC and DESC -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP Database Mailing List (http://www.php.net/) To unsubsc

Re: [PHP-DB] Re: Getting Results

2011-01-21 Thread Richard Quadling
On 21 January 2011 11:58, Karl DeSaulniers wrote: > I did not know you could do a SELECT inside a SELECT. Commonly known as a "sub select". You can use them like ... SELECT columns FROM ( SELECT columns FROM table) WHERE column IN (SELECT column FROM table) As part of a FROM or as part of a WH

[PHP-DB] Re: Getting Results

2011-01-21 Thread Karl DeSaulniers
I did not know you could do a SELECT inside a SELECT. Very nice! Thank you Andrew. And I take it ASC is "in ascending order"? So to do descending order I'd put DES or DEC? Just curious about that one. Thanks again. Best, Karl On Jan 21, 2011, at 4:48 AM, Andrew Holt wrote: Hi Karl, What a

[PHP-DB] RE: Getting Results

2011-01-21 Thread Andrew Holt
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 Use