MySQL - Query within a query

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

 



I am looking to do the following w/ MySQL and PHP.  Have 1 query that gets 
results, then use those results in another query:

$l = 2;
$result1 = ("SELECT * FROM Drivers WHERE League = $l");

$result2 = mysql_query("SELECT DriverID, Driver, CarNbr FROM Drivers LEFT 
JOIN $LeagueList ON Drivers.DriverID = $Result1.DriverID
   WHERE $Result1.DriverID) Is Null ORDER BY Drivers.DriverID");

I can do it w/ Access and MSSQL, but if I try in MySQL, i get an error, both 
in DBManager (MySQL interface), and in PHP.

Any help is appreciated.  Thanx!

Pete 

-- 
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