Testing for failure of mssql query.
Posted: Wed Aug 23, 2006 9:32 am
Ok so here is the idea, I am taking a result of a query and passing them to the next query.
It is working fine except in the event that the server being passed to the new query does not exist in the destination table. I am not sure how to test for this. I need to see these results as well.
That is how i have it coded now. I tied doing an isset on $result3, but I did it wrong or it didn't work. I also tried a die statement.
Any ideas?
It is working fine except in the event that the server being passed to the new query does not exist in the destination table. I am not sure how to test for this. I need to see these results as well.
Code: Select all
$query2= "select distinct(computer ), targetgroup
from susdb.dbo.VLO_ComputerStatus2
where SummarizationState =2 or SummarizationState =3 or SummarizationState =6";
$result2 = mssql_query($query2, $dbConn2);
$x="";
while ($row = mssql_fetch_assoc($result2)){
$val = $row['computer'];
$val2= $row['targetgroup'];
$val3="";
$val4="";
$val5="";
$val6="";
echo"-----$val----$val2<br>";
$query3 ="select owner1,owner2,owner3, location from servers.dbo.serverinfo where server ='$val' ";
$result3 = mssql_query($query3, $dbConn2);
$x++;
while ($row = mssql_fetch_assoc($result3)){
do some stuff
}Any ideas?