I've been doing manual reporting for some time now and would like to automate my table but i've hit a road block, i have two tables one that i manually alter(deletes) and a data pump (conversions) that i reference. Basically i run a look up find all the machines that should not have an app installed check the conversions table to make sure it's gone then update the deletes table with my findings but something is missing can you point me in the right direction?
<?
////////////////////uninstalls /////////////////
if ($form_type == 'uninstalled'){
$current_date = date('m-d-y');
/////////////////1st query pulls all the workstations have installed but not uninstalled/////////////////
$query = "select name,app from deletes where takeover = 'yes' and uninstalled <> 'yes'";
$result = mssql_query($query);
while ($row = @mssql_fetch_row($result)) {
////////2nd query takes data and looks for uninstalled or not and outputs machines not uninstalled//
$query1 = "select machine_name,package_name from conversions where date_current = '$current_date'
and machine_name ='$row[0]' and package_name ='$row[1]'";
$result1 = mssql_query($query1);
while ($row1 = @mssql_fetch_row($result1)) {
///////takes output and querys all machines that have the app but not that workstation//////////////////
/////////////////////no workey///////////////////////////////////////////////////////////
$query2 = "select name,app from deletes where takeover='yes' and uninstalled <> 'yes' and name <> '$row1[0]'
and app ='$row1[1]'";
$result2 = mysql_query($query2);
while ($row2 = @mysql_fetch_row($result2)) {
echo $row2[0];
echo "-\n";
echo $row2[1]."<br>";
/////////take output and update and update the unistalls/////////////////////////////
$query3 = "update deletes set uninstalled ='yes' where name ='$row2[0]' and app ='$row2[1]'";
$result3 = mssql_query($query3);
while ($row3 = @mssql_fetch_row($result2)) {
echo $row3[0];
echo $row3[1]."<br>";
}
}
}
}
}
?>