I'm having a bit of a problem with multiple queries (PHP 5.1.4, MSSQL Server)
When it comes to executing a single query and printing results, no problem. What I would like to accomplish, however, is to execute a query, then use one of the returned elements as a search string for a second query on a different table. After the execution of both queries I'd like to print the results of the first query and the second query.
So how do I get these two queries to work together?
$search_string1 = ($_POST['ordnum']);
$query1 = "SELECT OORDDT, OCUSNM, OCUSNO FROM swe_play.ORDHDR WHERE OORDNO LIKE $search_string1";
$result1 = @mssql_query($query1);
$search_string2 = ($result1['OCUSNO']);
$query2 = "SELECT CUSNO, ADD1, CITY, STATE, ZIP, FROM swe_play.CUSMAS WHERE CUSNO LIKE $search_string2";
$result2 = @mssql_query($query2);
-- Jason