RE: [PHP-DB] MySQL - Query within a query

2005-03-19 Thread Bastien Koert
Unlike ASP, $result1 is a handle to the dataset, not the data set itself. You need to access the data first and then incorporate that into your query like this: $l = 2; $result1 = (SELECT * FROM Drivers WHERE League = $l); $row = mysql_fetch_array($result1); $driverID = $row['DriverID'];

Re: [PHP-DB] MySQL - Query within a query

2005-03-19 Thread Larry E . Ullman
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